我对此声明有疑问:
select *
from texts
where id in (1, 3)
and address in ('address_one', 'address_another');
我想拥有满足这些条件的所有记录:
如果有办法吗?
答案 0 :(得分:5)
您需要重新编写WHERE子句,如下所示;
(id = 1 and address = 'address_one') or (id = 3 and address = 'address_other')
另一种方法可能是;
(cast(id as varchar(32)) + '_' + address) in ('1_address_one', '3_address_other')