乡亲们
我有一张附在一起的桌子
我们需要如下所示的拨号代码字段
拨号码列如下所示
id dialcode
640 1684
641 16842
642 168473
643 1758
644 1758284
645 1758285
基本上,parentid=0的拨号代码字段应该与parentid<>0所在的数字一起在拨号代码字段中进行更新。
如id=641,则拨号代码为16842。
发布于 2013-11-01 07:43:45
试试this..may,这是可能的答案
update table3 t1 left join table3 t2 on t1.parentid = t2.id
set t1.dialcode = CONCAT(t2.dialcode,t1.number) where t1.parentid<> 0
https://stackoverflow.com/questions/19722540
复制相似问题