日期:2014-05-16 浏览次数:20820 次
mysql> select * from test; +------+ | id | +------+ | 65 | | 1 | +------+ 2 rows in set (0.00 sec) mysql> select * from test where id in(1,65); +------+ | id | +------+ | 65 | | 1 | +------+ 2 rows in set (0.00 sec) mysql> show create table test; +-------+---------------------------------- -----------------+ | Table | Create Table | +-------+---------------------------------- -----------------+ | test | CREATE TABLE `test` ( `id` int(11) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | +-------+---------------------------------- -----------------+ 1 row in set (0.00 sec)
------解决方案--------------------
SELECT * FROM table where id REGEXP '65|66|67'
如果不是准确匹配