如标题所示 最近遇到一个问题,给存储过程添加参数,如果该参数为空,就不当作查询条件,不为空,才当做查询条件。 如下两种解决方法: 1、 select * from IC09 t WHERE t.AAC001 = NVL(条件,t.AAC001); 2、 select * from IC09 t where t.AAC001= (case when 条件=null then t.AAC001 else 条件 end)...
where sex='女' or sex is null 这样是查出性别为女或者性别为空的数据吧。我理解是这样:Select * from table where sex = (case when nvl(条件, '*') = '*' then sex else 条件 end);这样的话,传入是“女”,就是查询 sex=“女”,传入的是空,则查询全部。oracle 9i测试通过 ...