日期:2014-05-17 浏览次数:20604 次
SELECT * FROM table WHERE FIND_IN_SET('2',cid);
------解决方案--------------------
mysql> select find_in_set(2, "2,3,4");
+-------------------------+
| find_in_set(2, "2,3,4") |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select find_in_set(2, "52,3,4");
+--------------------------+
| find_in_set(2, "52,3,4") |
+--------------------------+
| 0 |
+--------------------------+
1 row in set (0.00 sec)
mysql> select find_in_set(2, "2,3,4");
+-------------------------+
| find_in_set(2, "2,3,4") |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.00 sec)