SELECT *
FROM tbllog_player
WHERE find_in_set( 3 , (select group_concat(role_id) from tbllog_player))
[MySQL]在where使用group_concat
本文介绍了一种使用SQL查询特定角色ID的方法。通过find_in_set函数和group_concat函数组合使用,可以有效地从tbllog_player表中查找包含指定角色ID的所有记录。
本文介绍了一种使用SQL查询特定角色ID的方法。通过find_in_set函数和group_concat函数组合使用,可以有效地从tbllog_player表中查找包含指定角色ID的所有记录。
SELECT *
FROM tbllog_player
WHERE find_in_set( 3 , (select group_concat(role_id) from tbllog_player))

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