解决group_concat(ids)之后,无法使用 in的问题
select * from tab1 where find_in_set( id , select group_concat(ids) from tab2)
本文介绍了一种解决在使用Group_Concat函数后无法直接配合IN操作符进行查询的方法。通过find_in_set函数实现从Group_Concat得到的字符串中查找特定ID,从而完成原本需要IN操作符实现的数据匹配。
解决group_concat(ids)之后,无法使用 in的问题
select * from tab1 where find_in_set( id , select group_concat(ids) from tab2)
986
967

被折叠的 条评论
为什么被折叠?