当前位置:网站首页>SQL中函数 decode()与 replace()的用法
SQL中函数 decode()与 replace()的用法
2022-04-23 18:34:00 【大胖某人】
Oracle将查询出的结果用别的值显示,例如:查出某个字段值为abc,可以换成123显示
语法:
replace一般使用
replace ( status , 'x' ,'男' )
即:将status字段中所有出现的x替换为男。
replace嵌套使用
replace(replace(replace(t.STATUS,'0','正常'),'1','暂停'),'2','停止')
即:将status字段中所有出现的0替换为正常,1替换为暂停,2替换为停止。
decode用法
decode(条件,值1,返回值1,值2,返回值2,…值n,返回值n)
decode(status,'0','正常','1','暂停','2','停止')
即:将status字段中所有出现的0替换为正常,1替换为暂停,2替换为停止。
版权声明
本文为[大胖某人]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_44369870/article/details/124345300
边栏推荐
- With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate
- CISSP certified daily knowledge points (April 15, 2022)
- 教你用简单几个步骤快速重命名文件夹名
- Mysql database backup command -- mysqldump
- WiFi ap6212 driver transplantation and debugging analysis technical notes
- 机器学习理论之(8):模型集成 Ensemble Learning
- Serial port debugging tools cutecom and minicom
- Ucosiii transplantation and use, reference punctual atom
- CISSP certified daily knowledge points (April 19, 2022)
- Use of regular expressions in QT
猜你喜欢
Differences between SSD hard disk SATA interface and m.2 interface (detailed summary)
视频边框背景如何虚化,简单操作几步实现
Stm32mp157 wm8960 audio driver debugging notes
Deep learning classic network analysis and target detection (I): r-cnn
【数学建模】—— 层次分析法(AHP)
powerdesigner各种字体设置;preview字体设置;sql字体设置
With the use of qchart, the final UI interface can be realized. The control of qweight can be added and promoted to a user-defined class. Only the class needs to be promoted to realize the coordinate
ctfshow-web361(SSTI)
Robocode tutorial 8 - advanced robot
listener. log
随机推荐
Ucosiii transplantation and use, reference punctual atom
Iptables - L executes slowly
Custom prompt box MessageBox in QT
listener. log
Resolves the interface method that allows annotation requests to be written in postman
Const keyword, variable and function are decorated with const
Error reported when running tensorboard: valueerror: duplicate plugins for name projector, solution
ctfshow-web361(SSTI)
【ACM】455. 分发饼干(1. 大饼干优先喂给大胃口;2. 遍历两个数组可以只用一个for循环(用下标索引--来遍历另一个数组))
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
Dynamically add default fusing rules to feign client based on sentinel + Nacos
ESP32 LVGL8. 1 - label (style 14)
STM32: LCD显示
powerdesigner各种字体设置;preview字体设置;sql字体设置
JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞
CISSP certified daily knowledge points (April 14, 2022)
K210串口通信
QT error: no matching member function for call to ‘connect‘
Using transmittablethreadlocal to realize parameter cross thread transmission
On iptables