SELECT top 5
day_description,
count(numberofdays) as number
FROM mytable
where department = 'departmentname'
group by day_description
我的选择带回了这样的东西:
day description number
holiday 32
working day 212
training day 5
meeting day 26
admin day 66
有没有办法添加一个新列,它指定 1-5,1 是最高值行,5 是最低值行。看起来像这样:
day description number top5ID
holiday 32 3
working day 212 1
training day 5 5
meeting day 26 4
admin day 66 2