• i think a simple test with an EXISTS and correlated subquery will get you want you want:

    With YOURTABLE (TICKET,STATUS)

    AS

    (

    SELECT 9543,1 UNION ALL

    SELECT 9543,5 UNION ALL

    SELECT 9543,5 UNION ALL

    SELECT 9544,1 UNION ALL

    SELECT 9546,1 UNION ALL

    SELECT 9547,1 UNION ALL

    SELECT 9547,5

    )

    --the above is just setup data to represent your data , wherever it is.

    --data like that makes it easy for anyone to offer helpful posts.

    --proposed example is just what is below.

    SELECT

    *

    FROM YOURTABLE OPENTIX

    WHERE NOT EXISTS(SELECT

    1

    FROM YOURTABLE CLOSEDTIX

    WHERE CLOSEDTIX.TICKET = OPENTIX.TICKET

    AND CLOSEDTIX.STATUS = 5)

    AND OPENTIX.STATUS = 1

    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!