blsn.net
当前位置:首页 >> Mysql数据库一个表字段中存了iD,并以逗号分隔,iD对... >>

Mysql数据库一个表字段中存了iD,并以逗号分隔,iD对...

SELECT a.aid AS '序号', a.`主管领导`, GROUP_CONCAT(b.`姓名`) AS `主管领导姓名` FROM a LEFT JOIN b on FIND_IN_SET(b.id , a.`主管领导`) GROUP BY a.aid ORDER BY a.aid ASC

试试下面这句行不 select name from B where id find_in_set(id,select sevice from A where id=1)

SELECT * FROM `task_detatils` WHERE FIND_IN_SET( '1', responsible_user) 将含有1的responsible_user列数据全部搜索出来

str = '重庆,四川,北京'; SELECT substring_index('重庆,四川,北京','.', 1); #重庆 SELECT substring_index('重庆,四川,北京','.', 2); #四川 SELECT substring_index('重庆,四川,北京','.', 3); #北京 mysql系统特性: 1、使用C和C++编写,并...

select ID,group_concat(NAME) as NAME from table group by ID; select ID,group_concat(NAME SEPARATOR ';') as NAME from a group by ID;

select a.*,b.* from a left join b on find_in_set(b.id,a.zd1)

select replace(concat('''',channel,''''),',',''',''') from tb_user where id='1';这样么

第一部分: FIND_IN_SET()函数用法, 查询用逗号分隔的字段, 表A中 go_value字段的值是以逗号分割, 查询 go_value字段中含有3的行: select * from A where find_in_set('3', go_value);

SELECT m.aid,m.b1id,n.bcon,m.b2id as b2id,o.bcon as b2con, m.b3id as b3id,p.bcon as b3con FROM `test` as m INNER JOIN test1 as n on m.b1id=n.bid INNER JOIN test1 as o on m.b2id=o.bid INNER JOIN test1 as p on m.b3id=p.bid; 结果:

没错啊,你想做什么

网站首页 | 网站地图
All rights reserved Powered by www.blsn.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com