I have the following query that returns rows based on a comma seperated list
Select * from Table where RecordID in (22,15,105,1,65,32)
I wo
I'd to the ordering in the client, but if you really want to do it in SQL, do it like this:
declare @T table (id int identity(1,1), RecordID int)
insert into @T (RecordID)
values (22), (15), (105), (1), (65), (32)
select * from
[table] t
inner join @t s on t.id=s.recordid
where t.id in (22, 15, 105, 1, 65, 32)
order by s.id
(works in SQL Server 2008)