Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: URGENT: sql group by clause has stopped working
> 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