sql更新,字典值转换,


update population set education_degree = (CASE 
 when education_degree='博士' THEN 0
when education_degree='研究生' THEN 1
when education_degree='本科' THEN 2
when education_degree='大专' THEN 3
when education_degree='中专或中技' THEN 4
when education_degree='技工学校' THEN 5
when education_degree='高中' THEN 6
when education_degree='初中' THEN 7
when education_degree='小学' THEN 8
when education_degree='文盲或半文盲' THEN 9
when education_degree='其他' THEN 99 END )
where education_degree in ('博士','研究生','本科','大专','中专或中技','技工学校','高中','初中','小学','文盲或半文盲','其他')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值