I cannot see how you can determine a different sort on the same column in one pass.
This can be done using a SProc, and the values would need to be passed as either a string of values (like an array) or as seperate params, due to the requirement to order by.
Using the SQL statement as above, load a temp table with the results you want. Because the order by may not be in numerical order, you will need to UNION result sets together to get the right order.
e.g.
select PRED from #TempTABLEA where PRED = @param1
UNION ALL
select PRED from #TempTABLEA where PRED = @param2
UNION ALL
select PRED from #TempTABLEA where PRED = @param2
(this would be where @param1=9, @param2=23, @param3=3)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.