• the trick is to join the table agaisnt itself.

    With MyCTE (GroupID,Item,Permission)

    AS

    (

    SELECT '123','D-Report','Y' UNION ALL

    SELECT '123','G-Report','Y' UNION ALL

    SELECT '134','D-Report','Y' UNION ALL

    SELECT '134','G-Report','N'

    )

    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

    Lowell


    --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!