【发布时间】:2022-07-11 19:38:02
【问题描述】:
I have two tables department and category.In my query result listing same department multiple times.I want to group departments based on category table priority column.
Eg Data:
id dept_name dept_category priority
1 Cardio category 2 2
2 Ortho category 3 3
3 Ortho category 1 1
4 ENT category 1 1
5 Ortho category 2 2
I wannt the reslt like:
id dept_name dept_category priority
1 Cardio category 2 2
3 Ortho category 1 1
4 ENT category 1 1
如何获取这样的结果。在我的类别表中,优先级为 1、2、3,然后 1 为最高优先级。我需要根据最高优先级对部门进行分组。
【问题讨论】:
标签: postgresql