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: URGENT: sql group by clause has stopped working

Re: URGENT: sql group by clause has stopped working

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 9 Aug 2002 00:40:01 -0700
Message-ID: <a6d06107.0208082340.7576c883@posting.google.com>


> I can't figure this out.
>
> select owner
> from smith
> where job = 'comp'
> and branch = '9'
> group by owner;
>
> How can the above query return duplicates?

If you want to select distinct values, use distinct:

select distinct owner
from smith where job = 'comp' and branch = '9';

Also, as other have pointed out, I have the feeling that there's a 'comp' and a 'comp ' or something in the table.

Hth
Rene Received on Fri Aug 09 2002 - 02:40:01 CDT

Original text of this message

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