title: SQL : Select Distinct rows by all columns but omit one column (say ID column)
body: <p>I am constructing a view by joining few tables to extract the data via Entity framework. As this view is having no unique column, EntityFramework could not retrive the correct result set (i.e. the first column is getting repeated).</p>
  
  <p>To resolve this I have added one ID column i.e. the ROW_NUMBER() &amp; made necessary changes in my .net code (Entity) </p>
  
  <p><a href="https://stackoverflow.com/questions/3977920/entity-framework-view-return-duplicate-records/12634113#12634113">Refer : Entity Framework. View return duplicate records</a></p>
  
  <p>Now real problem striked me, as this ID column atributed Unique identity to the earlier duplicate rows too :|.</p>
  
  <p>I want to retrive only distinct  rows without considering this ID / identity column in to picture. </p>
  
  <p>For example :</p>
  
  <pre><code>+--------+---------+-------------+-------------+
  | ID     | NUMBER  | COUNTRY     | LANG        |
  +--------+---------+-------------+-------------+
  | 1      | 3968    | UK          | English     |
  | 2      | 3968    | UK          | English     |
  | 3      | 1234    | Greece      | Greek       |
  | 4      | 1234    | Italy       | Italian     |
  </code></pre>
  
  <p>The retrival should happen like : (just take only one entry out of fisrt &amp; second row, as they are repeated, if we ignore the ID column)</p>
  
  <pre><code>+--------+---------+-------------+-------------+
  | ID     | NUMBER  | COUNTRY     | LANG        |
  +--------+---------+-------------+-------------+
  | 1      | 3968    | UK          | English     |
  | 3      | 1234    | Greece      | Greek       |
  | 4      | 1234    | Italy       | Italian     |
  </code></pre>
  
  <p>I have used some dummy columns above to illustrate my problem easily, else my real query looks something like :</p>
  
  <pre><code>Create VIEW [dbo].[vw_PlanDetails]
  AS
  SELECT **DISTINCT** ROW_NUMBER() OVER (ORDER BY PLAN_CODE_LONG) ID, PM.PLAN_CODE_LONG,     SA.SERVICE_AREA_NAME, SAC.COUNTY_NAME
  FROM             PLAN_MASTER AS PM INNER JOIN ...
  </code></pre>
  
  <p>...
  ...</p>
  
  <p>If required I can paste the whole query, but that might complicate the question.
  So expecting a generic answer based on my dummy tables.</p>