Possible Duplicate:
Delete duplicate records from a SQL table without a primary key
I have data:
SELECT
a
, b
FROM
(
select a = 1, b = 30
union all
select a = 2, b = 50
union all
select a = 3, b = 50
union all
select a = 4, b = 50
union all
select a = 5, b = 60
) t
I have to get output (next (order by a) dublicate records should be excluded from result set):
a b
----------- -----------
1 30
2 50
3 50 -- should be excluded
4 50 -- should be excluded
5 60