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-

enter image description here

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

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -