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 * from test where id ='8' or id like '8,%' or id like '%,8,%' or id like '%,8' 或者 select * from test where [con_cat](',',id,',') like '%,8,%' 注意把[con_cat]的[]去掉,还有_也去掉就可以了,可能百度把这个字母做了屏蔽

select oligo_id, tag_ids from wjl_oligo where tag_ids REGEXP '(^|,)5($|,)'; 2 3,5 3 5,6 5 3,5,7 7 5,15 10 5 13 3,5,6 14 3,5,7,8

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';这样么

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