Link to home
Start Free TrialLog in
Avatar of jl66
jl66Flag for United States of America

asked on

Request a high efficient query

Have a table T with the following data
T (c1 number(10), c2 varchar2(10))

c1    c2
1      B
1      C
2      A
3      D
4      A
4      A
5      A
5      B
6      C
6      A
6      D
7      E
8      B
8      C
....

Now want to get all C1 with only C2=A (single and duplicates). For the above example,

Want to get the records:
c1
2
4

Since C2 in all of the records are 'A', they are selected..

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Thanks for the catch on the typo.
Avatar of jl66

ASKER

The query is quite efficient. Thanks a lot for both.