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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Please help on SQL

Re: Please help on SQL

From: John K <john_at_demon.co.uk>
Date: 1998/03/27
Message-ID: <891032626.20589.0.nnrp-06.c2de082b@news.demon.co.uk>#1/1

In article <351A343B.5933F2EC_at_mns.bt.co.uk>, Ahmed <ahmed.dahdouh_at_mns.bt.co.uk> wrote:
> Try
> SELECT a, b
> FROM foo
> where 1 < (select count(*) from foo)
> GROUP BY a, b;
>
> Nuno Guerreiro 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 Received on Fri Mar 27 1998 - 00:00:00 CST

Original text of this message

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