Can Mysql Split a column?

前端 未结 7 1526
别那么骄傲
别那么骄傲 2020-11-22 03:00

I have a column that has comma separated data:

1,2,3
3,2,1
4,5,6
5,5,5

I\'m trying to run a search that would query each value of the CSV s

7条回答
  •  感情败类
    2020-11-22 03:14

    Usually substring_index does what you want:

    mysql> select substring_index("foo@gmail.com","@",-1);
    +-----------------------------------------+
    | substring_index("foo@gmail.com","@",-1) |
    +-----------------------------------------+
    | gmail.com                               |
    +-----------------------------------------+
    1 row in set (0.00 sec)
    

提交回复
热议问题