当前位置:网站首页>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 .
边栏推荐
猜你喜欢

【软件测试】04 -- 软件测试与软件开发

M2DGR 多源多场景 地面机器人SLAM数据集

1290_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS

Orin 两种刷机方式

C#学习笔记

Docker installs MySQL and uses Navicat to connect

Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)

SD_CMD_SEND_SHIFT_REGISTER

扫盲-以太网MII接口类型大全-MII、RMII、SMII、GMII、RGMII、SGMII、XGMII、XAUI、RXAUI

SOC_ SD_ DATA_ FSM
随机推荐
数学分析_笔记_第8章:重积分
[node] differences among NPM, yarn and pnpm
[software testing] 06 -- basic process of software testing
SD_CMD_SEND_SHIFT_REGISTER
testing framework
[software testing] 04 -- software testing and software development
[vscode] search using regular expressions
ethtool 原理介绍和解决网卡丢包排查思路(附ethtool源码下载)
U-boot initialization and workflow analysis
Ros2 - function package (VI)
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
.net core踩坑实践
[untitled]
【软件测试】03 -- 软件测试概述
[OBS] x264 Code: "buffer_size“
Orin two brushing methods
In C language, int a= 'R'
解读最早的草图-图像翻译工作SketchyGAN
[software testing] 02 -- software defect management
SD_CMD_RECEIVE_SHIFT_REGISTER