the trick is to join the table agaisnt itself.
With MyCTE (GroupID,Item,Permission)
SELECT '123','D-Report','Y' UNION ALL
SELECT '123','G-Report','Y' UNION ALL
SELECT '134','D-Report','Y' UNION ALL
SELECT * FROM MyCTE T1
LEFT OUTER JOIN MyCTE T2
ON T1.Item = T2.Item
AND T1.GroupID = '123'
AND T2.GroupID = '134'
WHERE T1.Permission <> T2.Permission
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!