【发布时间】:2013-05-01 08:34:05
【问题描述】:
select Priority,
case Priority
when 'Medium' then (Count(*)* 100 / (Select Count(*) From #tem where Priority = 'Medium'))
when 'High' then (Count(*)* 100 / (Select Count(*) From #tem where Priority = 'High'))
when 'Low' then (Count(*)* 100 / (Select Count(*) From #tem where Priority = 'Low'))
when 'Critical' then (Count(*)* 100 / (Select Count(*) From #tem where Priority = 'Critical'))
end as '% SLM Met'
from #tem where Bool = 'True'
group by Priority
order by
case Priority
WHEN 'Critical' THEN 1
WHEN 'High' THEN 2
WHEN 'Medium' THEN 3
WHEN 'Low' THEN 4
End
我们如何将其转换为 linq..
我想指定这个顺序以便让我的 UI 正确..
【问题讨论】:
标签: sql linq sql-to-linq-conversion