mysql - How to explode user id from a database column? -
i have table name messages. there column name receiver_id
need fetch record receiver_id = 4 getting null output.
see table screenshot-
above screenshot there 3rows. second , third rows exist 4
along other ids need explode , show second , third record.
how write mysql query?
storing comma separated values bad design should normalize
first storing association of receiver in junction table,if not able alter schema current situation can use find_in_set()
search values in comma separated list
select * table find_in_set(4,receiver_id ) >0
Comments
Post a Comment