随笔分类 -  Mysql

group_concat() 函数用法
摘要:没有办法在语句中直接使用if条件(存储过程可以),所以可以利用下面方法实现 方法1: SELECT *FROM ( SELECT *, 1 as source_table FROM hljtxeip_workday_holiday WHERE `year` = YEAR ( NOW()) AND ` 阅读全文
posted @ 2024-11-04 16:00 20211103 阅读(3) 评论(0) 推荐(0) 编辑
摘要:https://mp.weixin.qq.com/s/lqtvh9QkfwElkKiCiOmZeg 阅读全文
posted @ 2024-10-12 08:42 20211103 阅读(3) 评论(0) 推荐(0) 编辑
摘要:这条MySQL语句中使用了substring_index函数来处理training_pictures列的数据。下面是该函数的具体用法: substring_index(str,delim,count):这个函数会返回字符串str中第count个出现的分隔符delim之前的所有字符,或者之后的所有字符 阅读全文
posted @ 2024-07-30 09:14 20211103 阅读(8) 评论(0) 推荐(0) 编辑
摘要:https://mp.weixin.qq.com/s/MK3P5xzbs38QAjjdt-Zz5Q 阅读全文
posted @ 2024-07-26 15:15 20211103 阅读(2) 评论(0) 推荐(0) 编辑
摘要:SELECT attachment FROM hljtxeip_draft_notice select a.ID,substring_index(substring_index(a.attachment,',',b.help_topic_id+1),',',-1) from hljtxeip_dra 阅读全文
posted @ 2024-07-25 14:04 20211103 阅读(4) 评论(0) 推荐(0) 编辑
摘要:SHOW OPEN TABLES WHERE In_use > 0; SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS WHERE LOCK_TABLE = 'hljtxeip/hljtxeip_personworkrecord'; SELECT ID, U 阅读全文
posted @ 2024-07-11 13:57 20211103 阅读(1) 评论(0) 推荐(0) 编辑
摘要:INSERT INTO a( aax, aaz) ( SELECT aax, aaz FROM b WHERE x IN ( 1,2,3 ) ); 类似一个这种数据迁移的sql 如果用了where 条件请在条件上 完全遵从数据格式 如果偷懒 直接输入数字类型的 1,2,3 的话 就会报错runcat 阅读全文
posted @ 2023-12-29 14:10 20211103 阅读(88) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/carefree31441/article/details/119563685 阅读全文
posted @ 2023-10-08 13:32 20211103 阅读(8) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_36800514/article/details/115380100 -- 阅读权限 全239 部分9 select * from hljtxeip_institution where state = 1 and deleteState = 0 an 阅读全文
posted @ 2023-10-08 11:44 20211103 阅读(358) 评论(0) 推荐(0) 编辑
摘要:WITH RECURSIVE subordinates AS ( SELECT * FROM sys_dept WHERE dept_id = 1 -- 这里以员工ID为1为例 UNION ALL SELECT e.* FROM sys_dept e INNER JOIN subordinates 阅读全文
posted @ 2023-09-14 16:00 20211103 阅读(21) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示