I'm trying to formulate a query that will allow me to return all of the rows with the same ID number if one of the rows meets a certain criteria. My current table and desired tables are as follows:
Current Table:
ID Parameter
1 x
1 x
1 y
1 x
2 x
2 x
2 x
3 y
3 y
3 x
4 x
4 x
4 x
Desired Results:
ID Parameter
1 x
1 x
1 y
1 x
3 y
3 y
3 x
In this example, my parameter of interest is "y". Since y appears in at least one of the rows for ID's 1 and 3, then all of the row data for ID's 1 and 3 are selected while the rest are filtered out. Is there a way to write this in a where clause or will I need to consider another method?
Thank you!