• I am not sure that I understand your question correctly, but here is what I think you are looking for.

    ;WITH CTE as (select row_number() OVER(partition by Binder_no ORDER BY Binder_id)

    AS rn,office_id,Binder_id,Binder_no

    FROM [Rev_Binders])

    SELECT * FROM cte where rn = 1

    Results:

    rnoffice_idBinder_idBinder_no

    12105110 10 101

    12105110 12 102

    12105110 14 103

    12105110 16 104

    12105110 17 105

    12105110 20 106

    If my assumption as to what you require is NOT correct, please post your desired answer.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]