troubleshooting Question

SQL help

Avatar of Evan Cutler
Evan CutlerFlag for United States of America asked on
DatabasesOracle DatabaseSQL
4 Comments1 Solution555 ViewsLast Modified:
Greetings, I have a table:
TABLE A. with two columns:
PK dec, txt varchar2

The table has the following type of data
1     ALL
1     A
1     B
1     C
2     B
3     C
3     A
4     A
5     ALL
6     B
7     A
8     ALL
8     A
8     B
8     C

If you notice, the records can have A, B, C, or ALL with no constraints.  If ALL exists, they should have A, B, C in the table as well (SEE PK's 1 and 8).  Notice how PK 5 has ALL, but the A, B, nor C is in there.  This happens in sporatic places throughout my table of over 100K records.

I need to write a query that finds the "PK 5's", or in other words the "ALL's" with no families.  How do I locate them using SQL statement.

Thank you.
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros