当前位置:网站首页>工作记录:DB2查询数据,当字段为空时,赋值
工作记录:DB2查询数据,当字段为空时,赋值
2022-08-10 22:55:00 【自学Python爬虫】
原始数据如图:
赋值处理后的数据,如图:
我使用的SQL语句如下:
SELECT CASE WHEN PROD_CNAME='' THEN '方坯' else PROD_CNAME end as PROD_CNAME2 FROM BHCD01.TMM0001
讲解如下:
case when ...then...else...end as 别名
当字段prod_cname为空时赋值'方坯',否则赋值原来的值,end as 就是取别名
边栏推荐
猜你喜欢
随机推荐
德科立科创板上市:年营收7.3亿 市值59亿
gcc492 compile `.rodata‘ can not be used when making a PIE object; recompile with -fPIE
实例054:位取反、位移动
线程池如何监控,才能帮助开发者快速定位线上错误?
房间虚拟样板间vr制作及价格
windows10安装PostgreSQL14避坑分享
MUI框架开发app中出现的问题
How to bounce the shell
DC-8靶场下载及渗透实战详细过程(DC靶场系列)
leetcode:357. 统计各位数字都不同的数字个数
国内vr虚拟全景技术领先的公司
浅谈jsfuck编码
小程序平台工具如何选择和使用?
JS use regular expressions in g model and non g difference
JS学习 2022080
canvas
[uniapp] uniapp WeChat applet development: no such file or directory error when starting the WeChat developer tool
2021 IDEA creates web projects
koa框架(一)
Redis - 利用lua脚本控制密码错误次数超限,锁定账号