这种SQL 语句,只能这么写吗?
select * from 表 where 字段='a1',字段='a2',字段='a3',............字段='a100'
我不知道是否有优化的办法。
------解决方案--------------------
- SQL code
select * from 表 where 字段 in('a1','a2','a3',......)
------解决方案--------------------
- SQL code
如果后面的值是通过另外一张表查询出来的可以这样:select * from test where 字段 in(select col from 表名 where 过滤条件)