我在sql中有这个语法:
UPDATE fazerbem_carrinho_historico
SET pendencia_pago = '10.00',
pendenciahistorico = pendenciahistorico + '12'
WHERE data_compra = '76'
假设在pendenciahistorio
列中已经有'16'
值,应该发生什么,因此我提供更新,存储值1612
,但它们保存{{1}的总和1}},因为16 + 12
列是一个varchar,怎么解决它?
答案 0 :(得分:4)
||
运算符在SQLLite中用于 连接 字符串:
UPDATE fazerbem_carrinho_historico
SET pendencia_pago = '10.00',
pendenciahistorico = pendenciahistorico || '12'
WHERE data_compra = '76'
答案 1 :(得分:0)
对于字符串连接,请使用||
:
UPDATE fazerbem_carrinho_historico
SET pendencia_pago = '10.00',
pendenciahistorico = pendenciahistorico || '12'
WHERE data_compra = '76';