title: DISTINCT is not working for SELECT query in MSSQL
body: <p>Here i have the invoice details table.
  I need the all values without duplicate of <code>[invoiceno]</code>.
  I am try </p>
  
  <pre><code>select distinct invoiceno,name,addr1,addr2,id from invoice_table;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>invoiceno    name             addr1       addr2             id
  2016718001  Severus Sanpe   7,Hogwards, Sevilee,USA 7451    5
  2016718002  Severus Sanpe   7,Hogwards, Sevilee,USA 7451    8
  2016718002  Severus Sanpe   7,Hogwards, Sevilee,USA 7451    9
  </code></pre>
  
  <p>I want the result:</p>
  
  <pre><code> invoiceno   name             addr1       addr2             id
  2016718001  Severus Sanpe   7,Hogwards, Sevilee,USA 7451    5
  2016718002  Severus Sanpe   7,Hogwards, Sevilee,USA 7451    8
  </code></pre>
  
  <p>It's working fine without <code>id</code> in <code>SELECT</code>. But i need that also. 
  How to do this?</p>