Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: simple sql question - group by having ?
jobs wrote:
> I know this works
>
> Select columna From tablea Group by columna Having count(*) > 1
>
>
> But how can get columnb and columnc of the tablea table if i don't
> want to group by those columns?
>
> A join? a union?
SELECT cola, colb, colc
FROM t
WHERE cola IN (SELECT cola FROM (your_query_here));
One way among many. Also look at using EXISTS.
In the future always include your version when you post.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Mon Apr 23 2007 - 10:02:26 CDT