当前位置:网站首页>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
边栏推荐
- Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
- Daily network security certification test questions (April 18, 2022)
- Cygwin64 right click to add menu, and open cygwin64 here
- CISSP certified daily knowledge points (April 15, 2022)
- Creation and use of QT dynamic link library
- Keil RVMDK compiled data type
- Gson fastjason Jackson of object to JSON difference modifies the field name
- 玻璃体中的硫酸软骨素
- NVIDIA Jetson: GStreamer and openmax (GST OMX) plug-ins
- ctfshow-web361(SSTI)
猜你喜欢

昇腾 AI 开发者创享日全国巡回首站在西安成功举行

MATLAB小技巧(6)七种滤波方法比较

Teach you to quickly rename folder names in a few simple steps

Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash

Imx6 debugging LVDS screen technical notes

Robocode tutorial 8 - advanced robot

iptables初探

The vivado project corresponding to the board is generated by TCL script

Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time

Resolves the interface method that allows annotation requests to be written in postman
随机推荐
Keil RVMDK compiled data type
CANopen STM32 transplantation
logstash 7. There is a time problem in X. the difference between @ timestamp and local time is 8 hours
Error reported when running tensorboard: valueerror: duplicate plugins for name projector, solution
Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
教你用简单几个步骤快速重命名文件夹名
QT excel operation summary
Daily CISSP certification common mistakes (April 11, 2022)
Robocode tutorial 5 - enemy class
From introduction to mastery of MATLAB (2)
Daily network security certification test questions (April 15, 2022)
Ctfshow - web362 (ssti)
STM32: LCD显示
深度学习经典网络解析目标检测篇(一):R-CNN
QT curve / oscilloscope customplot control
14 py games source code share the second bullet
Daily CISSP certification common mistakes (April 15, 2022)
Feign requests the log to be printed uniformly
WIN1 remote "this may be due to credssp encryption Oracle correction" solution
Solution to Chinese garbled code after reg file is imported into the registry