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: simple sql question - group by having ?

Re: simple sql question - group by having ?

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 23 Apr 2007 08:02:26 -0700
Message-ID: <1177340546.267565@bubbleator.drizzle.com>


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.org
Received on Mon Apr 23 2007 - 10:02:26 CDT

Original text of this message

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