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 正确..