Re: Please help on SQL

From: Nuno Guerreiro <nuno-v-guerreiro_at_telecom.pt>
Date: 1998/03/30
Message-ID: <35206b75.92780491_at_news.telecom.pt>#1/1


On Fri, 27 Mar 1998 21:03:46 GMT, john_at_demon.co.uk (John K) wrote:
>> > On 25 Mar 1998 20:24:03 GMT, "Shetal Sheth"
>> > <sheths_at_bobcat.ent.ohiou.edu> wrote:
>> >
>> > SELECT a, b
>> > FROM foo
>> > GROUP BY a, b
>> > HAVING count(*) > 1;
>>
>
>Not sure that this will work. You can't group by unless either a or b is a group
>function which they are not. If there was a group function around a or b
>eg max(a) then you could group. Are you sure you don't want to order by ..
>
>John K
>

I believe I couldn't in the past. I've tried the following query (against Oracle 7.3.3) and it produced no syntax error:

select dummy
from dual
group by dummy
having count(*) > 1;

Nuno Guerreiro Received on Mon Mar 30 1998 - 00:00:00 CEST

Original text of this message