sql优化
梵依然
这个作者很懒,什么都没留下…
展开
-
海量sql语句查询代码优化
具体要注意的: 1.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null 可以在num上设置默认值0,确保表中num列没有null值,然后这样查询: select id from t where num=0 2.应尽量避免在 where 子句中使用转载 2014-03-20 22:40:54 · 667 阅读 · 0 评论 -
sql
sql对大小写不敏感,但数据库的数据对大小写敏感 select sale+0.15 from price select (sale+0.15)retail from price 对新列重命名 select sale+0.15 retail from price 对新列重命名 select -sale retail from price select (lowtemp - hig转载 2014-04-17 16:48:51 · 1020 阅读 · 0 评论