Comma separated value & wildcards in mysql

前端 未结 2 1904
没有蜡笔的小新
没有蜡笔的小新 2021-01-24 21:18

I have a value in my database with comma separated data eg.

11,223,343,123

I want to get the data, if it match a certain number (in this exampl

2条回答
  •  野性不改
    2021-01-24 21:54

    The wp_post_meta table is designed to hold loads of values, and for that simple reason (and because of database normalization, you should not never comma seperated lists as values in databases.

    If you absolutely must use it this way, there are some mySQL functions, one being FIND_IN_SET.

提交回复
热议问题