• Michael L John (4/26/2013)


    That's your answer. Account_id is the primary key. It is already unique. The use of distinct will produce the same number of rows as the query without it.

    If you are trying to make performance better, try using EXISTS or a simple inner join.

    Using INNER JOIN may change the results as the query here is just performing an existence check.

    EXISTS might give a different plan and probably better performance with the same output.


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/