当前位置:网站首页>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 .
边栏推荐
- 小米笔试真题一
- [MySQL 8.0 does not support capitalization of table names - corresponding scheme]
- [node] differences among NPM, yarn and pnpm
- Build a microservice cluster environment locally and learn to deploy automatically
- Marvell 88e1515 PHY loopback mode test
- The problem of configuring opencv in qt5.13.2 is solved in detail
- Binary search (half search)
- Ros2 - configuration development environment (V)
- SD_CMD_RECEIVE_SHIFT_REGISTER
- 摄像头的MIPI接口、DVP接口和CSI接口
猜你喜欢
Docker installs MySQL and uses Navicat to connect
Mathematical analysis_ Notes_ Chapter 8: multiple integral
SOC_ SD_ CMD_ FSM
Ros2 topic (VIII)
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
Ros2 - install ros2 (III)
Concurrent programming - how to interrupt / stop a running thread?
ROS2——topic话题(八)
Orin two brushing methods
Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
随机推荐
Netease to B, soft outside, hard in
Mipi interface, DVP interface and CSI interface of camera
ROS2——node节点(七)
Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"
Ros2 - configuration development environment (V)
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
Orin 两种刷机方式
纯碱是做什么的?
Unity 之 ExecuteAlways正在取代ExecuteInEditMode
Logical structure and physical structure
1290_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS
Orin two brushing methods
Volcano resource reservation feature
PHY驱动调试之 --- PHY控制器驱动(二)
PHY驱动调试之 --- MDIO/MDC接口22号和45号条款(一)
【obs】x264编码:“buffer_size“
二分查找(折半查找)
[OBS] x264 Code: "buffer_size“
[software testing] 06 -- basic process of software testing
【软件测试】05 -- 软件测试的原则