如何在mysql列中将数字插入当前值

时间:2011-09-05 03:50:04

标签: mysql

当前数据库birthday

ID  OldBirthday   NewBirthday
------------------------------ 
1   810401    
2   821112    
3   830725  

现在我希望从OldBirthday复制到NewBirthday,并在开头添加19

结果应该是

ID  OldBirthday   NewBirthday
------------------------------ 
1   810401        19810401
2   821112        19821112    
3   830725        19830725

让我知道..

UPDATE birthday 
SET NewBirthday = OldBirthday

1 个答案:

答案 0 :(得分:2)

UPDATE birthday SET NewBirthday = (OldBirthday + 19000000)