注释
SELECT name FROM userinfo #这是注释 /* 这是多行注释 */
order by 排序()
SELECT username FROM userinfo ORDER BY userid
order by 按多个列排序(weight从小到大,相同的按age从小到大)
SELECT username,weight,age FROM userinfo ORDER BY weight,age
SELECT username,weight,age FROM userinfo ORDER BY 2,3
以上两个语句效果一样
order by 降序排序(weight降序,age升序)
SELECT username,weight,age FROM userinfo ORDER BY weight DESC,age;