MySql中把一个字段替换成另一个字段

MySql中把一个字段替换成另一个字段,第1张

select case team

when 1 then '甲'

when 2 then ' 乙'

when 3 then '丙'

when 4 then ‘丁'

end as teamalias from 表

update b set bc1 = ( select ac1 from a where a.aid = b.bid)

where exists (select 1 from ac1 where a.aid = b.bid)

update B表 t1 inner join A表 t2 on t1.attr_value=t2.color_id

set t1.color_name=t2.color_name


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/8628658.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-19
下一篇 2023-04-19

发表评论

登录后才能评论

评论列表(0条)

保存