当前位置:网站首页>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 .
边栏推荐
- SOC_SD_DATA_FSM
- window navicat连接阿里云服务器mysql步骤及常见问题
- 【软件测试】02 -- 软件缺陷管理
- 小米笔试真题一
- Skywalking all
- SD_CMD_SEND_SHIFT_REGISTER
- 现在有html文件,和用vs制作的mvc(连接了数据库),怎么两个相连?
- [software testing] 04 -- software testing and software development
- Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
- MySQL setting trigger problem
猜你喜欢

Ros2 - configuration development environment (V)

三体目标管理笔记

ROS2——初识ROS2(一)

Ros2 - ros2 vs. ros1 (II)

PHY drive commissioning --- mdio/mdc interface Clause 22 and 45 (I)

An article was opened to test the real situation of outsourcing companies

数学分析_笔记_第8章:重积分

Orin 安装CUDA环境

Ros2 - Service Service (IX)

SOC_ SD_ CMD_ FSM
随机推荐
Xiaomi written test real question 1
Ros2 - ros2 vs. ros1 (II)
SD_ CMD_ SEND_ SHIFT_ REGISTER
Ros2 - configuration development environment (V)
Use the Paping tool to detect TCP port connectivity
[framework] multi learner
2022.06.27_每日一题
全局变量和静态变量的初始化
网易To B,柔外刚中
Marvell 88E1515 PHY loopback模式测试
In C language, int a= 'R'
Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
ModuleNotFoundError: No module named ‘picamera‘
The differences and connections among cookies, sessions, JWT, and tokens
SD_CMD_SEND_SHIFT_REGISTER
【软件测试】05 -- 软件测试的原则
ethtool 原理介绍和解决网卡丢包排查思路(附ethtool源码下载)
MySQL setting trigger problem
Do you choose pandas or SQL for the top 1 of data analysis in your mind?
Unity UGUI不同的UI面板或者UI之间如何进行坐标匹配和变换