Q:

Select one row that is a duplicate and also select the other rows that are not duplicates

here is my code 
select i.RefNo,i.Premium,i.Description from (select d.Description,c.IsActiveRecord,c.RefNo,c.MovementID, c.Premium,ROW_NUMBER() 
over(partition by c.premium order by c.refno) n from lif_mgm_t_contract c 
inner join SDT_LJG_T_MovementDescription d with (nolock) on c.MovementID = d.MovementID ) i
   where i.n = 1 and i.MovementID <> 0 

so for instance 
table
a
a
b

I want the query to return 
a
b and not just a hope this makes sense --only a beginner 

A:

try using a group by clause
SELECT OrderNumber
  FROM AccountOrder
  group by OrderNumber

so if my table has the following order numbers
1
2
2
3

the query would return
1
2
3

