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

Home -> Community -> Usenet -> c.d.o.server -> Re: select distinct

Re: select distinct

From: Rudy Fernandes <rferdy_at_pathcom.com>
Date: Sat, 28 Aug 1999 07:24:23 -0400
Message-ID: <935841166.261370514@news.pathcom.com>


Try

select customerno, max(name)
from table
group by customerno;

Rudy

On Fri, 27 Aug 1999, Mark Foley wrote:
>I have a table with the following columns
>
>customerno name
>1234 John
>1234 Bill
>1235 Jan
>1236 Mark
>
>
>What I want for a result set is:
>1234 John
>1235 Jan
>1236 Mark
>
>
>If I use "select distinct customerno,name from table"
>I still get all of the rows.
>
>"select distinct customerno from table" gets the unique customer numbers,
>but not the names.
>
>I have to believe there is a sql statement that will accomplish this...
>Can anyone help?
Received on Sat Aug 28 1999 - 06:24:23 CDT

Original text of this message

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