I have table which contains list of data ceparated by coma eg
x
deputy
1,2,3
2
4,6
I am trying to left joint it with IN clause, but without success
LEFT JOIN chat_user AS du
ON du.chat_user_id IN (message_item.deputy)
Advertisement
Answer
One option uses string functions:
left join chat_user as du
on ',' || message_item.deputy || ',' like '%,' || du.chat_user_id || ',%'