0

如何插入一些与其 id 连接的值,即

UPDATE `hosting`.`invoice` SET `invoice_no` = 'wb/1420/'+'invoice_id 
                           WHERE `invoice`.`invoice_id` != 38;
4

2 回答 2

1

使用mysql的concat功能

UPDATE `hosting`.`invoice` SET `invoice_no` = CONCAT('wb/1420/', invoice_id)
                           WHERE `invoice`.`invoice_id` != 38;
于 2013-08-08T06:01:48.103 回答
0

尝试像这样使用

$value = 'wb/1420/'.invoice_id;

UPDATE hosting.invoice SET invoice_no =$value  WHERE invoice.invoice_id != 38;
于 2013-08-08T06:02:41.620 回答