摘要: 批量写入 INSERT INTO abc.movie( name) VALUES ('杨戬'),('沉香'),('西游记'); do update set 插入更新 upsert on conflict(id) 主键或者唯一索引相同 存在则执行update excluded 为虚拟表 接受传过来的新 阅读全文
posted @ 2024-03-28 14:28 洞玄巅峰 阅读(70) 评论(0) 推荐(0) 编辑
摘要: --分页offset 和limit 位置可以互换 不影响结果 select * from abc.t_student offset 0 limit 2; select * from abc.t_student limit 2 offset 0; --表明加别名 用as 不用as 都可以 select 阅读全文
posted @ 2024-03-28 12:21 洞玄巅峰 阅读(9) 评论(0) 推荐(0) 编辑
摘要: #字段有函数不走索引 EXPLAIN select * from t_user where date(create_time)='2024-03-28'; #精确查询某一天走索引 #datetime 精确查询某一天走索引select * from t_user where create_time > 阅读全文
posted @ 2024-03-28 11:26 洞玄巅峰 阅读(174) 评论(0) 推荐(0) 编辑