buttonMASTER
asked on
Query to find certain rows in a table
I have a table that looks like this:
The data I have in that table is:
I need a query that will give me the the rows where the 'Active' values column associated with that 'Parent ID' are all the same.
So for this example, I want the rows where the 'Parent ID' is 125 because the value in 'Active' columns are all 0.
Table
Name Type
------------------ ------------------
ID NUMBER
Parent_ID NUMBER
Data DOESN'T_MATTER
Active NUMBER
The data I have in that table is:
ID parent_id data active
----------------------------------------------------
1 13 value_1 0
2 13 value_2 1
3 24 value_3 0
4 24 value_4 1
5 125 value_5 0
6 125 value_6 0
7 125 value_7 0
8 6 value_8 1
9 6 value_9 1
10 6 value_10 0
I need a query that will give me the the rows where the 'Active' values column associated with that 'Parent ID' are all the same.
So for this example, I want the rows where the 'Parent ID' is 125 because the value in 'Active' columns are all 0.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER