刚学SQL SEVER,有一个问题请问一下大家,希望得到大家的帮助,先谢了!
SELECT EmpID,EmpSalaryGrade,EmpGrade
FROM Employee
ORDER BY EmpGrade,EmpSalaryGrade
与
SELECT EmpID,EmpSalaryGrade,EmpGrade
FROM Employee
ORDER BY EmpGrade+EmpSalaryGrade
中
ORDER BY EmpGrade+EmpSalaryGrade 与 ORDER BY EmpGrade,EmpSalaryGrade
的区别是什么?
------解决方案--------------------
ORDER BY EmpGrade+EmpSalaryGrade
按照两者的和进行排序
ORDER BY EmpGrade,EmpSalaryGrade
先按照EmpGrade排序,如果EmpGrade字段相同,再按照EmpSalaryGrade排序。