今天主要我学习了SQL的查询语句!
查询时条件语句的顺序是 where group by having order by limit
1.where后加条件语句
2.group by 分组(统计 平均 最大最小)AVG(伪列)
3.伪列作为条件放在having的后面
4.能改变结果就放在前面,不能的就放在后面。
三表连接 select * from 表1,表2,表3 where 表1,表2,表3 where 表1.ID=表2.ID and
表2.sid=表3.sid and 条件;
今天主要我学习了SQL的查询语句!
查询时条件语句的顺序是 where group by having order by limit
1.where后加条件语句
2.group by 分组(统计 平均 最大最小)AVG(伪列)
3.伪列作为条件放在having的后面
4.能改变结果就放在前面,不能的就放在后面。
三表连接 select * from 表1,表2,表3 where 表1,表2,表3 where 表1.ID=表2.ID and
表2.sid=表3.sid and 条件;