CREATE TABLE IF NOT EXISTS `testa` ( `dwid` varchar(20) DEFAULT NULL, ""dwname"" varchar(20) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `testa` (`ids`) VALUES (""1"",""001""), (""2"",""dw2""), (""3"",""dw3""), (""4"",""dw4""), (""5"",""dw5""); 想同时查询 dwid 为1,3,5的记录。 |
|
搞定了, 用in
|
|
20分 |
where dwid in (“”1″”,””2″”,””3″”)
|