Atualize várias linhas em uma única consulta do MySQL
Eu estou tentando executar isso:
UPDATE test
SET col2=1 WHERE col1='test1',
SET col2=3 WHERE col1='test2';
O erro que estou recebendo:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
Minha mesa:
CREATE TABLE `test` (
`col1` varchar(30) NOT NULL,
`col2` int(5) DEFAULT NULL,
PRIMARY KEY (`col1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
É algo sobre,
no final da primeira linha. Quando eu mudei para;
, não reconheceu a col2. Como posso fazer isso em uma consulta?