我正在使用phpMyAdmin并通过插入sql代码创建了父表,但是当使用相同数据插入查询而没有表头时,我收到语法错误:........
SQL查询:
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1001, ‘Aladdin Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1002, ‘Alumilite Lighting');
MySQL说:文档
1064 - 您的SQL语法出错;检查与MySQL服务器版本对应的手册,以便在'Lighting'附近使用正确的语法); 插入
manufacturers
(manufacturerid
,name
)VALUES(第1行100'
这是SQL:
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1001, ‘Aladdin Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1002, ‘Alumilite Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1003, ‘Ametrix Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1004, ‘Arancia Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1005, ‘Atlantic Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1006, ‘Atomis Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1007, ‘Axis Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1008, ‘Bock Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1009, ‘Brightlines');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1010, ‘C-3 Lighting Solutions');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1011, ‘Carmanah');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1012, ‘Cast Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1013, ‘Castaldi');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1014, ‘CD Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1015, ‘Corelite');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1016, ‘Dark');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1017, ‘DLS Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1018, ‘Eclipse Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1019, ‘Edge Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1020, ‘Egoluce');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1021, ‘Element');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1022, ‘Eureka Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1023, ‘Evenlite, Inc.');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1024, ‘Evergreen Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1025, ‘Fail-Safe Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1026, ‘Functional Devices');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1027, ‘Greengate Controls');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1028, ‘Halo Commercial ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1029, ‘Halo Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1030, ‘Ilfari');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1031, ‘Illumitex');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1032, ‘iLumin');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1033, ‘Impact Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1034, ‘Incon Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1035, ‘Invue Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1036, ‘iO Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1037, ‘Iota Engineering');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1038, ‘IRiS Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1039, ‘ISI Inverter Systems');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1040, ‘Ivalo Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1041, ‘J & J Electronics');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1042, ‘Jefferson Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1043, ‘JLC Tech');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1044, ‘King Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1045, ‘Kurtzon Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1046, ‘KW Industries');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1047, ‘Lightology');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1048, ‘Liteworx');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1049, ‘Louvers International');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1050, ‘Lumark Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1051, ‘Lumascape');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1052, ‘Lumenpulse');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1053, ‘Lumiere Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1054, ‘Lumux Architectural Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1055, ‘Luraline Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1056, ‘Lutron Electronics');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1057, ‘Lutron Shading Solutions ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1058, ‘Main Street Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1059, ‘Matthew\'s Fan Company');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1060, ‘McFadden Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1061, ‘McGraw-Edison Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1062, ‘Metalux Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1063, ‘MWS Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1064, ‘Nafco International');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1065, ‘Neoray Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1066, ‘Nexxus Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1067, ‘Phoenix Products');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1068, ‘Picasso Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1069, ‘Portfolio Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1070, ‘Pure Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1071, ‘RSA Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1072, ‘Sentry Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1073, ‘Shaper Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1074, ‘Sillites');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1075, ‘SMC LED');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1076, ‘Sports Sentry Systems');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1077, ‘SQ1 Precision Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1078, ‘Stagecraft Industries');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1079, ‘Starfire Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1080, ‘Street Lighting Equipment');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1081, ‘Stresscrete');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1082, ‘Structura ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1083, ‘Sure-Lites Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1084, ‘Tech Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1085, ‘Technilite ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1086, ‘The Light Edge ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1087, ‘Tiella Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1088, ‘Tokistar Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1089, ‘USL Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1090, ‘Venture Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1091, ‘Verbatim Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1092, ‘Viso Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1093, ‘Vista Pro');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1094, ‘Vistosi');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1095, ‘Visual Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1096, ‘Voigt Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1097, ‘Wilmette Lighting');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1098, ‘WPT Design ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1099, ‘XAL Lighting ');
INSERT INTO `manufacturers` (`manufacturerid`, `name`) VALUES (1100, ‘Zaneen Lighting');
答案 0 :(得分:0)
看起来开头的单引号是一个聪明的报价,结尾的单引号只是一个勾号。确保‘
代替'
。
INSERT INTO manufacturers (manufacturerid, name) VALUES (1100, ‘Zaneen Lighting');
应该是
INSERT INTO manufacturers (manufacturerid, name) VALUES (1100, 'Zaneen Lighting');