Sql中如何在参数为空时查询所有
sqlserver 中
select * from yonghuxx t where t.yonghuh= (case when :yonghuh='' then t.yonghuh else :yonghuh end);
oracle 中
select * from yonghuxx t where t.i_y=2020 and (:yonghuhis null or t.yonghuh= :yonghuh);
sqlserver 中
select * from yonghuxx t where t.yonghuh= (case when :yonghuh='' then t.yonghuh else :yonghuh end);
oracle 中
select * from yonghuxx t where t.i_y=2020 and (:yonghuhis null or t.yonghuh= :yonghuh);