SELECT mysql column with comma separated values

后端 未结 4 947
一生所求
一生所求 2021-01-19 06:40

Consider I have a table like this.

+-------------+---------------+----------------+---------------+
+     id      +    column 1   +    column 2    +    column 3           


        
4条回答
  •  臣服心动
    2021-01-19 07:06

    use FIND_IN_SET() -- a builtin function for mysql to search a string

    SELECT  *
    FROM    tableName
    WHERE column 1 = 'values' and  FIND_IN_SET('a',column 3 )>0
    
    • sample

    • REFER

提交回复
热议问题