3

我想在 MySQL 中执行查询,但它不起作用。这是查询:

Update chambre set nombre_lit = 5 and prix = 10000 where code_ch = 2

如果我执行此脚本,它将起作用:

Update chambre set  prix = 10000 where code_ch = 2
Update chambre set nombre_lit = 5  where code_ch = 2

但我只想使用一条线。

4

2 回答 2

3

COMMA如果您有多个列要更新而不是使用AND

UPDATE chambre 
SET    nombre_lit = 5, 
       prix = 10000 
WHERE  code_ch = 2
于 2012-12-22T15:30:54.703 回答
1

试试这个:-

Update chambre set nombre_lit = 5 , prix = 10000 where code_ch = 2
于 2012-12-22T15:31:20.773 回答