oracle where条件如果id为空查出全部
答案:1 悬赏:80
解决时间 2021-03-07 21:38
- 提问者网友:相思瘸子
- 2021-03-07 05:19
oracle where条件如果id为空查出全部
最佳答案
- 二级知识专家网友:孤伤未赏
- 2021-03-07 05:56
where sex='女' or sex is null 这样是查出性别为女或者性别为空的数据吧。
我理解是这样:
Select * from table where sex = (case when nvl(条件, '*') = '*' then sex else 条件 end);
这样的话,传入是“女”,就是查询 sex=“女”,传入的是空,则查询全部。
oracle 9i测试通过
我理解是这样:
Select * from table where sex = (case when nvl(条件, '*') = '*' then sex else 条件 end);
这样的话,传入是“女”,就是查询 sex=“女”,传入的是空,则查询全部。
oracle 9i测试通过
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯