我正在尝试通过连接MySQL表中几个单元格的位来生成ID。我想要摆脱 - 和:并且只有ID中的数字。我收到了以下语法错误:
update scan_data
set @scanDate1 = replace(scanDate,'-','')
set @scanTime1 = replace(scanTime,'-','')
scanID = concat(right(scanContent,2),right(@scanDate1,2),right(@scanTime1,2))
我需要改变什么?
答案 0 :(得分:0)
试试这个
update scan_data set scanID = concat(right(scanContent, 2),
right(replace(scanDate,'-',''), 2),
right(replace(scanTime,'-',''), 2)
);