-3

I have a table called Orders, column and values of table.

Column [Order Priority] can have one of 4 values: Critical, High, Medium, Low. Ship_tt can have one of 3 values: Som, Tre, Dung.

I want to calculate percentage 'Som','Tre','Dung' of Critical, High, Medium, Low.

Thanks for your help.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
iamHTV
  • 1

1 Answers1

0
SELECT ORDER_PRIORITY, 100. * COUNT(*) / SUM(COUNT(*)) OVER ()
FROM @T T
GROUP BY ORDER_PRIORITY