SELECT语句的完整语法如下,其中只有SELECT 和 FROM是必需的:
SELECT [DISTINCT | ALL] field_listFROM table_name_list [WHERE search_conditions] [GROUP BY expression][HAVING search_condition][ORDER BY order_expression [ASC | DESC]]
2.然后是GROUP BY, HAVING, ORDER BY.
2.BETWEEN: BETWEEN 30 AND 50
3.IS [NOT] NULL
4.AND: condition1 AND condition2
5.OR
6.IN: IN ('zhang san','li si','wang wu')
7.NOT: WHERE NOT NAME='zhang san'
8.LIKE以及通配符:LIKE '李%'表示所有李开头的字符串
2.MAX():最大数
3.MIN():最小数
4.AVG():平均值
5.COUNT():查询student表中所有的记录数
SELECT COUNT(*) AS total_numberFROM student