Re: Simple question for SQL Student

From: snpe <snpe(at)infosky(dot)net>
To: "Johnny_5555" <dsiebert(at)u(dot)washington(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Simple question for SQL Student
Date: 2001-05-23 15:33:58
Message-ID: 01052317335806.01172@spnew
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 21 May 2001 01:27, Johnny_5555 wrote:
> I want to use an aggregate function in the WHERE clause and SQL Server 7
> won't let me? Specifically, I need to find a customer ID where the budget
> is equal to MAX(budget). Is my logic wrong? How can I display the the
> customer ID with the biggest budget? Any help is really appreciated. TIA
>
>
>
select customerId,max(budget)
from <table_name>
group by customerId
having mx(budget)=xxx

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-05-23 15:45:48 Re: A Couple of Questions on Blobs
Previous Message Feite Brekeveld 2001-05-23 14:54:56 Re: IpcMemoryCreate