随笔分类 -  sql

mysql,pgsql
摘要:1-获取 json中的属性值 【 列名 -> '$.属性名' 】 select extra -> '$.car_name' from m_table where '$.car_name'="jojo"; 2-优化查询性能,构建虚拟列,并在虚拟列上加索引 (json_extract:从指定数据中提取属 阅读全文
posted @ 2022-04-04 11:26 魔杰Lee 阅读(1492) 评论(0) 推荐(0)
摘要:mysql查看存储过程: show procedure status; 删除存储过程DROP PROCEDURE [ IF EXISTS ] <过程名> 事件查看 SHOW EVENTS; 删除事件 DROP EVENT [IF EXISTS] event_name; 阅读全文
posted @ 2021-10-21 14:05 魔杰Lee 阅读(50) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/zhaokai0130/article/details/83052455?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none- 阅读全文
posted @ 2020-03-26 21:10 魔杰Lee 阅读(448) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/ldj3/p/9288187.html 批量更改 update 一般的方式: <update id="updateData"> <foreach collection="list" item="obj" separator=";"> UPDATE jo 阅读全文
posted @ 2020-03-26 20:59 魔杰Lee 阅读(10761) 评论(0) 推荐(0)
摘要:INSERT INTO table ( "clo1", "col2", "col3", "col4", "col5" )VALUES ( 1, 10, NULL, '2019-12-19 13:38:35', '新年活动16张卡券'), ( 2, 11, NULL, '2019-12-19 15:0 阅读全文
posted @ 2019-12-19 15:19 魔杰Lee 阅读(34267) 评论(0) 推荐(1)
摘要:使用insert into tablA select * from tableB语句时, 一定要确保tableB后面的where,order或者其他条件,都需要有对应的索引, 来避免出现tableB全部记录被锁定的情况。 通过sql一步处理 insert into table_name(column 阅读全文
posted @ 2019-12-05 17:52 魔杰Lee 阅读(1889) 评论(0) 推荐(0)