滿足5個(gè)條件中任意四個(gè)條件都可以的實(shí)現(xiàn)方法。
一、使用case when實(shí)現(xiàn)
select * from 表名
where (case when 條件1 then 1 else 0 end + case when 條件2 then 1 else 0 end + case when 條件3 then 1 else 0 end + case when 條件4 then 1 else 0 end + case when 條件5 then 1 else 0 end) >= 10;