1、order by接在from后面,如果有where语句的话,接在where语句后面。
2、order by默认情况下,升序排列,如果需要降序排列,在列名后加上desc关键字。
3、声明多个列降序排列,每一个列多需要添加desc关键字。
4、如果一个语句同时包含了order by和limit关键字,limit需要接在order by后面。
5、判断每一列是否非空,可以用select * from book where name is null;
6、在过滤选择不满足特定值的行时,NULL值不会被返回出来。
例如 select * from book name != ‘book'; name为空的行不会被返回出来。