06 2020 档案

摘要:空字段赋值:NVL 给值为null的数据赋值 select nvl(age,20) from t_preson; 时间类: date_format:格式化时间 select date_format(time,''yyyy-MM-dd") ; date_add:时间和天数相加 select date_ 阅读全文
posted @ 2020-06-15 21:01 saber丶吾王 阅读(156) 评论(0) 推荐(0)
摘要:select * from a where id in (select id from b) 等价于: for select id from b for select 8 from a where a.id = b.id 当b表数据必须小于a表数据时,in优于exists select * from 阅读全文
posted @ 2020-06-11 20:55 saber丶吾王 阅读(184) 评论(0) 推荐(0)
摘要:索引失效: 全值匹配:索引全部引用 最佳左前缀法则,查询从索引的最左前列开始并且不跳过中间索引 索引列上少计算或类型转换 范围之后全失效 尽量使用覆盖索引,查询字段和 ,避免使用 select * 使用 !=或<>会导致无法使用索引,进行全表查询 is null 或 is not null 无法使用 阅读全文
posted @ 2020-06-11 15:55 saber丶吾王 阅读(106) 评论(0) 推荐(0)