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: Steve Halko <steveh_at_redshift.com>
Date: Mon, 30 Aug 1999 00:57:04 -0700
Message-ID: <rskec5rjj7194@corp.supernews.com>


You have multiple names for a customerno. Both John & Bill have 1234 as customerno and you want it to return only John? What is your criteria for returning John instead of Bill?

Once you define that criteria, you'll have to build it into your SQL to eliminate Bill.

Mark Foley <foleym_at_meftechno.com> wrote in message news:7q7btd$d5r_at_chronicle.concentric.net...
> 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 Mon Aug 30 1999 - 02:57:04 CDT

Original text of this message

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