php - Mysql with regular expression -
i have query regarding regular expression.i have design table contain 3 column 1 column contain member ids separated commas.i showing table structure.please follow
send_id member_id 1 1211,23,34 2 1,23 i want select send_id 2 data contain member_id 1.
this query using
select * table column regexp '^[1]+$'; but query giving me both row.please me.
with regards
rahul
never store separate values in 1 column
normalize structure like
send_id member_id 1 1211 1 23 1 34 2 1 2 23
if still want regex, be
select * t column regexp '(^|[^0-9])1([^0-9]|$)'
Comments
Post a Comment