当前位置:Gxlcms > 数据库问题 > Mysql 相关

Mysql 相关

时间:2021-07-01 10:21:17 帮助过:2人阅读

代码如下:
select * from users where YEAR(adddate)<2007;

将在每个行上进行运算,这将导致索引失效而进行全表扫描,因此我们可以改成:

复制代码代码如下: select * from users where adddate<‘2007-01-01‘;

6.不使用NOT IN和<>操作



Mysql 相关

标签:

人气教程排行