---------通过order by 语句进行排序:
--1.降序order by 列名desc
--2.升序order by 列名 或order by 列名asc
--3.order by语句必须一定要放在整个sql语句的最后。
--4.根据多列进行排序
--5.可以按照表达式进行排序
--现根据英语成绩排序,再根据数学成绩排序(先按照英语成绩排序,当英语成绩相同的时候再按照数学成绩排序)
select * from TblScore order by tEnglish desc,tmath desc
select * from biao
inner join ..
where ...
gourp by ...
having ....
order by ..
w english 100,math=20
n english 20,math=100
select
*,
平均分=(tEnglish+tmath)*1.0/2
from TblScore
order by 平均分 desc
select
*
from TblScore
order by (tEnglish+tmath)*1.0/2 desc
SELECT * --3.
FROM Score --1.
where english>=60 and math>=60 --2.
ORDER BY english DESC,math DESC --4.
原文:http://www.cnblogs.com/hao-1234-1234/p/6185236.html