I have very simple problem that I can\'t solve. I need to do something like this:
select distinct * from (1, 1, 1, 2, 5, 1, 6).
Anybody can
This works on SQL Server 2005 and if there is maximal number:
SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY a.id) NUMBER FROM syscomments a CROSS JOIN syscomments b) c WHERE c.NUMBER IN (1,4,6,7,9)