Oracle数据库查询条件使用三元表达式

来源:互联网 发布:java init和cinit 编辑:程序博客网 时间:2024/04/30 09:02

工作中遇到过这样的需求,
在oracle数据库中:

查询语句

select (参数) from 表A where A条件 and B 条件;
但是在B条件中会需要进行类似于三元判断,可以用如下代码

假如三目运算这么写 x?y:z对应的条件表达式这么写  (x and y or z and !x)即:select (参数) from 表A where A条件 and (x and y or z !X);
0 0