select *
from folder f,uploads u
where u.id=f.folderId
and FIND_IN_SET('8', '15,9,13,27')
请告诉我相当于预定义或用户定义的 postgresql 函数
最佳答案
你不应该首先存储逗号分隔值,但你可以这样做:
select *
from folder f
join uploads u ON u.id = f.folderId
where '8' = ANY (string_to_array(some_column,','))
string_to_array()
根据传递的分隔符将字符串转换为真正的数组
关于postgresql - mysql FIND_IN_SET 相当于 postgresql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35169412/