SELECT
m1.ID,
m1.RESOURCE_TYPE,
m1.SORT
FROM
resource_manage m1
LEFT JOIN resource_manage m2 ON m1.RESOURCE_TYPE = m2.RESOURCE_TYPE
GROUP BY
m1.ID
ORDER BY
m1.RESOURCE_TYPE,
m1.SORT
流程:
1. 表(m1)左关联自身(m2) 关联条件为 m1.RESOURCE_TYPE = m2.RESOURCE_TYPE (相当于)
2.