MySQL query finding values in a comma separated string

后端 未结 11 1579
孤独总比滥情好
孤独总比滥情好 2020-11-21 23:40

I have a field COLORS (varchar(50)) in a my table SHIRTS that contains a comma delimited string such as 1,2,5,12,15,. Each number repr

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 00:07

    FIND_IN_SET is your friend in this case

    select * from shirts where FIND_IN_SET(1,colors) 
    

提交回复
热议问题