我收到了这个错误,这让我感到疯狂,任何人都可以帮忙 MySQL说:文档
#1064 - 您的SQL语法出错;查看与您的MySQL服务器版本相对应的手册,以便在'Fermentum Street','Balvano','P5 4MR',06925697768,04675467216,'pure @ commod'附近的第4行使用正确的语法
这是代码:
DELETE FROM Branch;
INSERT INTO Branch
(branchNo, street, city, postcode, telNo, faxNo, email) values
('B001', ’7 Fermentum Street’, 'Balvano', 'P5 4MR', 06925697768, 04675467216, 'pure@commodsum.org'),
('B002', '66 Rutrum Road’, ’Cropalati', 'WZ5 8BZ', 06061881811, 01762692460, 'felis@eleifend.ca'),
('B003', '21 Fast Road', ‘Manchester’, ’MV3 3AG', 01069686611, 02161256151, 'sed@reetposuere.org'),
('B004', '89 Eros Road’, ’Campano', 'C5K 1AY', 04713509428, 08683205705, 'luctus@utnisi.co.uk'),
('B005’, ’21 Harbour Road’, ’Portsmouth’, ’BS2 7AJ’, 01234567890, 01234567891, ’boats@boatsforus.com’),
('B006', '57 Lectus Street', 'Stornaway', 'B6 5CQ', 03451135340, 04667526884, 'semper@sentuse.com'),
('B007', '1 Dictum’, ’Freetown’, 'FP6 6DB', 02158833092, 03471665376, 'elit@pede.edu’),
('B008’, '32 Site’, ’Williams Lake', 'R8X 4CZ', 07988177200, 02359143354, 'ligula@eu.edu’),
('B009’, '84 Felis Road’, ’France’, ’FD9 8EB', 08233247583, 06991371955, 'ornare@isid.net’),
('B010’, '29 Nascetur Road', 'Archennes', 'X4 7ZZ', 00073470059, 00146946683, 'elit@ittis.ca’),
('B011’, '21 Sed Street’, ’Senftenberg', 'I3X 1JA', 03175544001, 03303607701, 'massa@ading.org’),
('B012’, '36 Arcu Road', ‘Damam’, ’DN0 7ZL', 00748620378, 04347090006, 'justo@semum.edu’),
('B013’, '87 Vitae street’, ’Cerchio', 'D8C 3WL', 07850220231, 09407309996, 'non@ipsumnunc.ca’),
('B014’, '61 Duis Street’, ’Rio', 'WB1 1KF', 04272972336, 03780916592, 'justo@Ediet.net’),
('B015’, '4 Vestibulum Road', 'Stony', 'SO5P 3SL', 03066416104, 06798350690, 'ante@Quisque.org');
答案 0 :(得分:1)
在Mysql中,字符串始终用'
分隔。您有一些’
或‘
。
将'
替换为INSERT INTO Branch(branchNo, street, city, postcode, telNo, faxNo, email) values
('B001', '7 Fermentum Street', 'Balvano', 'P5 4MR', 06925697768, 04675467216, 'pure@commodsum.org'),
('B002', '66 Rutrum Road', 'Cropalati', 'WZ5 8BZ', 06061881811, 01762692460, 'felis@eleifend.ca'),
('B003', '21 Fast Road', 'Manchester', 'MV3 3AG', 01069686611, 02161256151, 'sed@reetposuere.org'),
('B004', '89 Eros Road', 'Campano', 'C5K 1AY', 04713509428, 08683205705, 'luctus@utnisi.co.uk'),
('B005', '21 Harbour Road', 'Portsmouth', 'BS2 7AJ', 01234567890, 01234567891, 'boats@boatsforus.com'),
('B006', '57 Lectus Street', 'Stornaway', 'B6 5CQ', 03451135340, 04667526884, 'semper@sentuse.com'),
('B007', '1 Dictum', 'Freetown', 'FP6 6DB', 02158833092, 03471665376, 'elit@pede.edu'),
('B008', '32 Site', 'Williams Lake', 'R8X 4CZ', 07988177200, 02359143354, 'ligula@eu.edu'),
('B009', '84 Felis Road', 'France', 'FD9 8EB', 08233247583, 06991371955, 'ornare@isid.net'),
('B010', '29 Nascetur Road', 'Archennes', 'X4 7ZZ', 00073470059, 00146946683, 'elit@ittis.ca'),
('B011', '21 Sed Street', 'Senftenberg', 'I3X 1JA', 03175544001, 03303607701, 'massa@ading.org'),
('B012', '36 Arcu Road', 'Damam', 'DN0 7ZL', 00748620378, 04347090006, 'justo@semum.edu'),
('B013', '87 Vitae street', 'Cerchio', 'D8C 3WL', 07850220231, 09407309996, 'non@ipsumnunc.ca'),
('B014', '61 Duis Street', 'Rio', 'WB1 1KF', 04272972336, 03780916592, 'justo@Ediet.net'),
('B015', '4 Vestibulum Road', 'Stony', 'SO5P 3SL', 03066416104, 06798350690, 'ante@Quisque.org');
,您的插入将成功:
{{1}}
答案 1 :(得分:0)
不要使用'仅限使用'。无论你在哪里使用'替换它'
('B001', '7 Fermentum Street', 'Balvano', 'P5 4MR', 06925697768, 04675467216, 'pure@commodsum.org')