当前位置:网站首页>Oracle code use
Oracle code use
2022-07-05 07:13:00 【Just as young】
Preface
When maintaining company code , It was found that ORACLE SQL To write the mapper.xml Of documents , There's a decode function , Let's learn its usage .
Use
Here is a simple usage
decode( Name or Operation expression , Judge the condition , value 1, value 2)
If 【 Name or Operation expression 】 The value of is equal to the judgment condition , Then return the value 1, Otherwise, return the value 2. Let's take a concrete example , Suppose the table name is table:
decode(table.id,null,0,1)
The above example means table.id If null, Whole decode The value of the expression is 0, Otherwise 1. Of course , In most cases, we will use and for comparison :
select *
from table
where decode(table.id,null,0,1)=1
That's all decode Simple usage .
边栏推荐
猜你喜欢
随机推荐
[tf1] save and load parameters
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
Use the Paping tool to detect TCP port connectivity
.net core踩坑实践
PowerManagerService(一)— 初始化
GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
PHY drive commissioning - phy controller drive (II)
解读最早的草图-图像翻译工作SketchyGAN
An article was opened to test the real situation of outsourcing companies
1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析
testing framework
ROS2——常用命令行(四)
ROS2——topic话题(八)
【Node】nvm 版本管理工具
ROS2——配置开发环境(五)
mingling
Ros2 - first acquaintance with ros2 (I)
Sre core system understanding
Interpretation of the earliest sketches - image translation work sketchygan
[vscode] search using regular expressions









