• Your requirements are a bit unclear but this may work for you

    WITH CTE AS(

    SELECT book,position,

    ROW_NUMBER() OVER(PARTITION BY position ORDER BY book) AS rn

    FROM mytable)

    SELECT a.book, a.position

    FROM CTE a

    WHERE EXISTS(SELECT * FROM CTE b WHERE b.position = -a.position

    AND b.rn = a.rn)

    ORDER BY book;

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537