我的mysql表名products.
如何获取这个表的数据。
表模式
id| catid |subcatid
-----------------
1 | 5 | 2,3,5
SELECT * FROM products where subcatid=2
不正确
如何写出正确的sql。
最佳答案
SELECT * FROM products where find_in_set(2,subcatid)
考虑规范化你的表格
关于php - 如何匹配列中的 CSV 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8456960/