retrieve resultset based on where clause condition order in sql server -


consider following table

colid  value       100   b     200   c     300   d     400   e     500 

what query retrieving values colid 'c','a','d' in same order?

for particular ordering have like:

select * mytable colid in ('c', 'a', 'd')     order        case colid           when 'c' 0           when 'a' 1           else 2        end 

Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -