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);

posted @ 2021-01-21 17:07  BengBaLaHei  阅读(569)  评论(0)    收藏  举报