时间:2021-07-01 10:21:17 帮助过:22人阅读
select * from system_user where date(createtime) >= '2015-06-01'优化后:
select * from system_user where createtime >= '2015-06-01'
select * from system_user where age + 10 >= 20优化后:
select * from system_user where age >= 10
select * from table_a a left join table_b b on a.id = b.id left join table_c c on a.id = c.id where a.id > 100 and b.id < 200
select * from ( select * from table_a where id > 100 ) a left join( select * from table_b where id < 200 )b on a.id = b.id left join table_c on a.id = c.id
select * from system_user where age > 10优化后:
select username,email from system_user where age > 10
insert into system_user(username,passwd) values('test1','123456') insert into system_user(username,passwd) values('test2','123456') insert into system_user(username,passwd) values('test3','123456')
insert into system_user(username,passwd) values('test1','123456'),('test2','123456'),('test3','123456')
Mysql写出高质量的sql语句的几点建议
标签:mysql写出高质量的sql语句的几点建 高质量的sql语句