当前位置:网站首页>Usage of functions decode() and replace() in SQL
Usage of functions decode() and replace() in SQL
2022-04-23 18:35:00 【Fat sb】
Oracle Display the query results with other values , for example : Find out that the value of a field is abc, Can be replaced by 123 Show
grammar :
replace In general use
replace ( status , 'x' ,' male ' )
namely : take status All occurrences in the field x Replace with male .
replace Nesting uses
replace(replace(replace(t.STATUS,'0',' normal '),'1',' Pause '),'2',' stop it ')
namely : take status All occurrences in the field 0 Replace with normal ,1 Replace with pause ,2 Replace with stop .
decode usage
decode( Conditions , value 1, Return value 1, value 2, Return value 2,… value n, Return value n)
decode(status,'0',' normal ','1',' Pause ','2',' stop it ')
namely : take status All occurrences in the field 0 Replace with normal ,1 Replace with pause ,2 Replace with stop .
版权声明
本文为[Fat sb]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231834007037.html
边栏推荐
- 14个py小游戏源代码分享第二弹
- 【ACM】70. climb stairs
- 【ACM】376. Swing sequence
- 机器学习实战 -朴素贝叶斯
- Error reported when running tensorboard: valueerror: duplicate plugins for name projector, solution
- On iptables
- Win1远程出现“这可能是由于credssp加密oracle修正”解决办法
- 【数学建模】—— 层次分析法(AHP)
- Introduction to quantexa CDI syneo platform
- 解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
猜你喜欢
QT tablewidget insert qcombobox drop-down box
Teach you to quickly rename folder names in a few simple steps
Machine learning practice - naive Bayes
Notepad + + replaces tabs with spaces
How to restore MySQL database after win10 system is reinstalled (mysql-8.0.26-winx64. Zip)
视频边框背景如何虚化,简单操作几步实现
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
os_authent_prefix
logstash 7. There is a time problem in X. the difference between @ timestamp and local time is 8 hours
Iptables - L executes slowly
随机推荐
Permission management with binary
CANopen usage method and main parameters of object dictionary
Feign requests the log to be printed uniformly
CISSP certified daily knowledge points (April 15, 2022)
Daily CISSP certification common mistakes (April 14, 2022)
Introduction to quantexa CDI syneo platform
Hard core parsing promise object (do you know these seven common APIs and seven key questions?)
【ACM】70. 爬楼梯
14 py games source code share the second bullet
STM32: LCD display
【科普】CRC校验(一)什么是CRC校验?
QT notes on qmap container freeing memory
WIN1 remote "this may be due to credssp encryption Oracle correction" solution
Ctfshow - web362 (ssti)
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
【数学建模】—— 层次分析法(AHP)
ctfshow-web361(SSTI)
Robocode tutorial 8 - advanced robot
After CANopen starts PDO timing transmission, the heartbeat frame time is wrong, PDO is delayed, and CANopen time axis is disordered
Dynamically add default fusing rules to feign client based on sentinel + Nacos