1.筛选字段注意点:
select 字段名 别名 from table1 where 条件1。条件中不能出现要筛选的字段别名,只能是表中实际字段名称。
2.左连接,右连接,内连接等注意点:
select A.字段,B.字段,C.字段
from table1 A
left join table2 B
on 连接条件1
and 连接条件2
left join table C
on 连接条件
where 筛选条件1
and 筛选条件2
(where要写在最后)
3. 大于号小于号等符号不走索引
建议用between and 替换
SQL注意点
最新推荐文章于 2023-04-15 19:05:34 发布