在where中使用decode函数
来源:互联网 发布:知我药妆芙丽芳丝 编辑:程序博客网 时间:2024/04/30 03:59
在where中使用decode函数达到要求。
select * from zjk_pos_supplier_order
where ((decode(:code, NULL, 1, 0) = 1) or code = :code)
and order_date >= :order_date;
以上语句如果:code变量赋值为null,则相当于语句
select * from zjk_pos_supplier_order
where order_date >= :order_date;
当:code变量不为null时,则相当于
select * from zjk_pos_supplier_order
where code = :code
and order_date >= :order_date;
对于where语句后是否可以用case或decode语句,答案是可以的,但要保证where语句中仍然是=值判断语句。
- 在where中使用decode函数
- 不应该在where子句中使用聚合函数
- 聚合函数不能在where子句使用
- Oracle中Decode()函数使用技巧
- [摘录]Oracle中Decode()函数使用技巧
- Oracle 中DECODE 函数的使用简介
- Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- [摘录]Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- Oracle中decode()函数的使用技巧
- Oracle中Decode()函数的使用
- Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- Oracle中Decode()函数使用技巧
- UICollectionView 基本使用(配合Flickr API)
- linux 下软件安装(一)
- centos将用户添加到sudo用户组的方法
- [转载]ngxin fastcgi性能
- SOA自学之路
- 在where中使用decode函数
- 如何查看本机电脑flash的版本
- Deep Learning(深度学习)学习笔记整理系列之(七)
- UNDO表空间
- leetcode 128: Surrounded Regions
- opencv-模板匹配
- session与会话cookie
- 0030算法笔记——【回溯法】最大团问题和图的m着色问题
- 常用工具