Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I need count condition in where clause.

1019123Jul 30 2015 — edited Jul 30 2015

Hi All ,

I have a data ,

ID AMT Product

1100A
1100B
1100C
1100D
225A
240E
255F
350B
350A
350C
350G
412H
413E
414A
415I

i need folowing result

 

IDAMTProduct
1100A
1100B
1100C
1100D
350B
350A
350C
350

G

I have tried following query but it is not working

select

ID,

AMT,

Product

from t

group by ID,AMT,Product

having count( distinct ID)=count( distinct AMT)

It is returning all the rows.

Please help

This post has been answered by Solomon Yakobson on Jul 30 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2015
Added on Jul 30 2015
9 comments
1,660 views