如何在MySQL查询中交叉两个逗号分隔的字符串?

时间:2015-10-23 10:54:53

标签: mysql

我想从两列mysql表中交叉两个逗号分隔的字符串:

我的查询如下:

select ucg.*, SUBSTRING_INDEX(GROUP_CONCAT(seek_mentorship_in),  ',','100000') as skill_seeker_list
from user_career_goals as ucg
where SUBSTRING_INDEX(GROUP_CONCAT(seek_mentorship_in), ',','100000') IN  (select GROUP_CONCAT(provide_mentorship_in) from user_career_goals)
and user_id=784;

1。对于user_id是784
2。我想要同一个表中所有user_ids的列表,其中seek_mentorship_in逗号分隔的字符串与所有provide_mentorship_in逗号分隔的字符串相交。

enter image description here

0 个答案:

没有答案