Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Select greatest value for account number

Re: Select greatest value for account number

From: TurkBear <johng_at_mm.com>
Date: Fri, 11 Feb 2000 18:09:18 GMT
Message-ID: <38a44fcd.7030970@204.181.81.99>

Or, for a more general result set:

select Acct_No,max(Amount)
from table
group by Acct_No;

hth

andreyNSPAM_at_bookexchange.net (NetComrade) wrote:

>SELECT MAX(amount) WHERE acct_no=2;
>
>On Fri, 11 Feb 2000 15:08:03 GMT, "Craig Alexander" <craig_at_itas.net>
>wrote:
>
>>I have a scenario where an account number has multiple dollar amounts
>>associated with it. What I want to do is select the largest amount
>>associated with the account number.
>>.
>>Here is what the table looks like
>>
>>Acct_No Amount
>>1 20
>>1 21
>>1 45
>>2 5
>>2 7
>>2 67
>>
>>For Acct_No '2' I would like to bring back the Amount of '67' etc.
>>
>>
>>I'm relatively new to this and appreciate any help
>>
>>Thanks
>>Craig
>>
>>--
>>_______________________
>>
>>Craig Alexander
>>Island Tel Advanced Solutions
>>
>>
>
>---------------
>In case I forgot to mention:
>We use Oracle 7.3.4 on Solaris 2.6, 2.7 boxes
>---------------
>Andrey Dmitriev eFax: (978) 383-5892 Daytime: (917) 750-3630
>AOL: NetComrade ICQ: 11340726 remove NSPAM to email

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------    http://www.newsfeeds.com The Largest Usenet Servers in the World! ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==----- Received on Fri Feb 11 2000 - 12:09:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US