日期:2014-05-18  浏览次数:20413 次

求一sql语句,在线等,解决马上结贴
表   product
表里的字段为   id,productname

id为int型   productname为varchar型

要搜索ID值为1和2的sql语句我用
select   *   from   product   where   id   in(1,2)
那如果我想搜索productname值为   aaa和bbb的值的记录应该怎么写sql语句
我用select   *   from   product   where   productname   in(aaa,bbb)这种语句不行啊

------解决方案--------------------
select * from product where productname = 'aaa ' or productname = 'bbb '
------解决方案--------------------
select * from product where productname in( 'aaa ', 'bbb ')