title: How to prevent duplicated records when applying ORDER BY NEWID() to fetch them randomly?
body: <p>I tried using the solution provided in <a href="https://stackoverflow.com/questions/1117761/sql-query-to-return-rows-in-random-order">Return rows in random order</a> to fetch random records in my query. But I have to add <code>NEWID()</code> to the list of columns I want to fetch or otherwise I will not be able to add <code>ORDER BY NEWID()</code> . Unfortunately it makes my resultset to contain duplicate records.</p>
  
  <p>For more clarification, this query makes my results to have duplicates due to existence of NEWID() among requested columns:</p>
  
  <pre><code>SELECT distinct top 4 
                Books.BookID,
                Books.Authors,                  
                Books.ShortTitle,               
                NEWID()                 
    FROM Books 
    inner join Publishers on Books.PublisherID = Publishers.PublisherID
  
    ORDER BY NEWID()
  </code></pre>
  
  <p>How can I overcome this issue of not fetching unique records (Here BookID is PK)?</p>