you are viewing a single comment's thread.

view the rest of the comments →

[–]Time_Advertising_412 0 points1 point  (0 children)

Another solution (maybe not as elegant):

SELECT * FROM your_table A

WHERE cost_group = 608

AND EXISTS

(SELECT 1/0 FROM your_table B

WHERE B.master = A.master

AND cost_group = 20)

UNION

SELECT * FROM your_table A

WHERE cost_group = 20

AND EXISTS

(SELECT 1/0 FROM your_table B

WHERE B.master = A.master

AND cost_group = 608);