MySQL 1064: You have an error in your SQL syntax

2019-08-07 18:56发布

问题:

I need some help in this SQL Code. I am new to SQL and using the Sams Teach Yourself SQL.

   INSERT INTO `eli`.`checks`
(`check`,
`payee`,
`amount`,
`remarks`)
VALUES
(500,'John Dree',450.00,'Bills');
INSERT INTO `eli`.`checks`
(`check`,
`payee`,
`amount`,
`remarks`)
VALUES
(575,'Ma Belle',150.00,'Gas Bills');
INSERT INTO `eli`.`checks`
(`check`,
`payee`,
`amount`,
`remarks`)
VALUES
(600,'Jon Cash',350.00,'Shopping');

I am getting error 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 'payee, amount, reINSERT INTO eli`.checks' at line 1

Thank you :)

回答1:

Try this?

INSERT INTO `eli`.`checks` (`check`, `payee`, `amount`, `remarks`) VALUES
(500, 'John Dree', 450.00, 'Bills'),
(575, 'Ma Belle', 150.00, 'Gas Bills'),
(600, 'Jon Cash', 350.00, 'Shopping');