2012-06-05 24 views
4

我有giviing下面提到的錯誤此MySQL查詢插入查詢,我無法弄清楚,爲什麼Mysql的插入查詢被固定

1064 - 你在你的SQL語法錯誤;在'VALUES('edinburgh','edinburgh * glasgow','Loreum ipsim'),VALUES('newcastle','line 3)附近使用正確的語法檢查與您的MySQL服務器版本相對應的手冊

INSERT INTO wp_widget_custom (name,centers,description)  
VALUES ('glasgow', 'glasgow*edinburgh' ,'Loreum ipsim'), 
VALUES ('edinburgh', 'edinburgh*glasgow' ,'Loreum ipsim'), 
VALUES ('newcastle', 'newcastle*middles-brough' ,'Loreum ipsim'), 
VALUES ('leeds', 'leeds' ,'Loreum ipsim'), 
VALUES ('manchester', 'manchester' ,'Loreum ipsim'), 
VALUES ('nottingham', 'nottinghamshire*lichfield' ,'Loreum ipsim'), 
VALUES ('lichfield', 'lichfield*birmingham*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('birmingham', 'lichfield*birmingham*milton-keynes' ,'Loreum ipsim'), 
VALUES ('milton-keynes', 'milton-keynes*hemel-hempstead*hertfordshire' ,'Loreum ipsim'), 
VALUES ('cardiff', 'cardiff*bristol-international' ,'Loreum ipsim'), 
VALUES ('bristol', 'bristol-international*bristol*cardiff' ,'Loreum ipsim'), 
VALUES ('plymouth', 'plymouth' ,'Loreum ipsim'), 
VALUES ('southampton', 'southampton*hemel-hempstead*reading*maidenhead*slough' ,'Loreum ipsim'), 
VALUES ('reading', 'hemel-hempstead*hertfordshire*reading*maidenhead*slough*guildford' ,'Loreum ipsim'), 
VALUES ('slough', 'surrey*hertfordshire*hemel-hempstead*reading' ,'Loreum ipsim'), 
VALUES ('hemel-hempstead', 'slough*surrey*guildford*bromley*london*billericay*hertfordshire*hemel' ,'Loreum ipsim'), 
VALUES ('london', 'hempstead*maidenhead' ,'Loreum ipsim'), 
VALUES ('crawley', 'crawley*bromley*guildford*surrey*london' ,'Loreum ipsim'), 
VALUES ('bromley', 'billericay*crawley*london*billiericay*bromley' ,'Loreum ipsim'), 
VALUES ('upminster', 'crawley' ,'Loreum ipsim'), 
VALUES ('billericay', 'billericay*london*bromley' ,'Loreum ipsim'), 
VALUES ('livingston', 'edinburgh*glasgow' ,'Loreum ipsim'), 
VALUES ('renfrewshire', 'edinburgh*glasgow' ,'Loreum ipsim'), 
VALUES ('northumberland', 'newcastle' ,'Loreum ipsim'), 
VALUES ('west-yorkshire', 'leeds' ,'Loreum ipsim'), 
VALUES ('cheshire', 'manchester' ,'Loreum ipsim'), 
VALUES ('nottinghamshire', 'nottinghamshire' ,'Loreum ipsim'), 
VALUES ('staffordshire', 'lichfield*birmingham*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('warwickshire', 'milton-keynes*birmingham' ,'Loreum ipsim'), 
VALUES ('northamptonshire', 'milton-keynes' ,'Loreum ipsim'), 
VALUES ('south-gloucestershire', 'bristol-international*bristol*cardiff' ,'Loreum ipsim'), 
VALUES ('north-somerset', 'bristol*bristol-international*cardiff' ,'Loreum ipsim'), 
VALUES ('devon', 'plymouth' ,'Loreum ipsim'), 
VALUES ('hampshire', 'southampton*guildford*surrey*reading*maidenhead*slough' ,'Loreum ipsim'), 
VALUES ('berkshire', 'southampton*maidenhead*reading*slough*surrey' ,'Loreum ipsim'), 
VALUES ('maidenhead', 'guildford*hemel-hempstead*hertfordshire' ,'Loreum ipsim'), 
VALUES ('surrey', 'surrey*guildford*reading*slough' ,'Loreum ipsim'), 
VALUES ('sussex', 'bromley*crawley' ,'Loreum ipsim'), 
VALUES ('kent', 'crawley' ,'Loreum ipsim'), 
VALUES ('essex', 'bromley*sittingbourne*london*london*billericay*bromley' ,'Loreum ipsim'), 
VALUES ('hertfordshire', 'hemel-hempstead*hertfordshire*slough*milton-keynes*maidenhead*slough' ,'Loreum ipsim'), 
VALUES ('buckinghamshire', 'hemel-hempstead*hertfordshire' ,'Loreum ipsim'), 
VALUES ('oxfordshire', 'milton-keynes' ,'Loreum ipsim'), 
VALUES ('leicestershire', 'lichfield*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('derbyshire', 'nottinghamshire*lichfield' ,'Loreum ipsim'), 
VALUES ('portsmouth', 'southampton' ,'Loreum ipsim'), 
VALUES ('gloucester', 'bristol*milton-keynes*birmingham*lichfield' ,'Loreum ipsim'), 
VALUES ('coventry', 'nottinghamshire' ,'Loreum ipsim'), 
VALUES ('stoke-on-trent', 'manchester*lichfield*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('bolton', 'manchester*leeds' ,'Loreum ipsim'), 
VALUES ('huddersfield', 'leeds' ,'Loreum ipsim'), 
VALUES ('liverpool', 'manchester' ,'Loreum ipsim'), 
VALUES ('merseyside', 'manchester' ,'Loreum ipsim'), 
VALUES ('leicester', 'birmingham*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('bradford', 'leeds' ,'Loreum ipsim'), 
VALUES ('wolverhampton', 'birmingham*lichfield*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('dudley', 'birmingham*lichfield*nottinghamshire*hemel-hempstead*hertfordshire*slough' ,'Loreum ipsim'), 
VALUES ('luton', 'maidenhead' ,'Loreum ipsim'), 
VALUES ('preston', 'manchester' ,'Loreum ipsim'), 
VALUES ('sunderland', 'newcastle*middlesbrough*birmingham*lichfield*nottinghamshire' ,'Loreum ipsim'), 
VALUES ('walsall', 'manchester' ,'Loreum ipsim'), 
VALUES ('swansea', 'cardiff' ,'Loreum ipsim'), 
VALUES ('norfolk', 'thetford-forest' ,'Loreum ipsim'), 
VALUES ('norwich', 'thetford-forest' ,'Loreum ipsim'), 
VALUES ('hull', 'hull' ,'Loreum ipsim'); 
enter code here 
+4

您只需要指定'VALUES'一次。只要刪除該關鍵字的所有其他事件即可。 – eggyal

+0

兄弟,我想通過1查詢插入 –

+0

像我說的,只是刪除該關鍵字的所有其他事件。 – eggyal

回答

3
INSERT INTO wp_widget_custom (name,centers,description) VALUES  
('glasgow', 'glasgow*edinburgh' ,'Loreum ipsim'), 
('edinburgh', 'edinburgh*glasgow' ,'Loreum ipsim'), 
('newcastle', 'newcastle*middles-brough' ,'Loreum ipsim'), 
('leeds', 'leeds' ,'Loreum ipsim'), 
('manchester', 'manchester' ,'Loreum ipsim'), 
('nottingham', 'nottinghamshire*lichfield' ,'Loreum ipsim'), 
('lichfield', 'lichfield*birmingham*nottinghamshire' ,'Loreum ipsim'), 
('birmingham', 'lichfield*birmingham*milton-keynes' ,'Loreum ipsim'), 
('milton-keynes', 'milton-keynes*hemel-hempstead*hertfordshire' ,'Loreum ipsim'), 
('cardiff', 'cardiff*bristol-international' ,'Loreum ipsim'), 
('bristol', 'bristol-international*bristol*cardiff' ,'Loreum ipsim'), 
('plymouth', 'plymouth' ,'Loreum ipsim'), 
('southampton', 'southampton*hemel-hempstead*reading*maidenhead*slough' ,'Loreum ipsim'), 
('reading', 'hemel-hempstead*hertfordshire*reading*maidenhead*slough*guildford' ,'Loreum ipsim'), 
('slough', 'surrey*hertfordshire*hemel-hempstead*reading' ,'Loreum ipsim'), 
('hemel-hempstead', 'slough*surrey*guildford*bromley*london*billericay*hertfordshire*hemel' ,'Loreum ipsim'), 
('london', 'hempstead*maidenhead' ,'Loreum ipsim'), 
('crawley', 'crawley*bromley*guildford*surrey*london' ,'Loreum ipsim'), 
('bromley', 'billericay*crawley*london*billiericay*bromley' ,'Loreum ipsim'), 
('upminster', 'crawley' ,'Loreum ipsim'), 
('billericay', 'billericay*london*bromley' ,'Loreum ipsim'), 
('livingston', 'edinburgh*glasgow' ,'Loreum ipsim'), 
('renfrewshire', 'edinburgh*glasgow' ,'Loreum ipsim'), 
('northumberland', 'newcastle' ,'Loreum ipsim'), 
('west-yorkshire', 'leeds' ,'Loreum ipsim'), 
('cheshire', 'manchester' ,'Loreum ipsim'), 
('nottinghamshire', 'nottinghamshire' ,'Loreum ipsim'), 
('staffordshire', 'lichfield*birmingham*nottinghamshire' ,'Loreum ipsim'), 
('warwickshire', 'milton-keynes*birmingham' ,'Loreum ipsim'), 
('northamptonshire', 'milton-keynes' ,'Loreum ipsim'), 
('south-gloucestershire', 'bristol-international*bristol*cardiff' ,'Loreum ipsim'), 
('north-somerset', 'bristol*bristol-international*cardiff' ,'Loreum ipsim'), 
('devon', 'plymouth' ,'Loreum ipsim'), 
('hampshire', 'southampton*guildford*surrey*reading*maidenhead*slough' ,'Loreum ipsim'), 
('berkshire', 'southampton*maidenhead*reading*slough*surrey' ,'Loreum ipsim'), 
('maidenhead', 'guildford*hemel-hempstead*hertfordshire' ,'Loreum ipsim'), 
('surrey', 'surrey*guildford*reading*slough' ,'Loreum ipsim'), 
('sussex', 'bromley*crawley' ,'Loreum ipsim'), 
('kent', 'crawley' ,'Loreum ipsim'), 
('essex', 'bromley*sittingbourne*london*london*billericay*bromley' ,'Loreum ipsim'), 
('hertfordshire', 'hemel-hempstead*hertfordshire*slough*milton-keynes*maidenhead*slough' ,'Loreum ipsim'), 
('buckinghamshire', 'hemel-hempstead*hertfordshire' ,'Loreum ipsim'), 
('oxfordshire', 'milton-keynes' ,'Loreum ipsim'), 
('leicestershire', 'lichfield*nottinghamshire' ,'Loreum ipsim'), 
('derbyshire', 'nottinghamshire*lichfield' ,'Loreum ipsim'), 
('portsmouth', 'southampton' ,'Loreum ipsim'), 
('gloucester', 'bristol*milton-keynes*birmingham*lichfield' ,'Loreum ipsim'), 
('coventry', 'nottinghamshire' ,'Loreum ipsim'), 
('stoke-on-trent', 'manchester*lichfield*nottinghamshire' ,'Loreum ipsim'), 
('bolton', 'manchester*leeds' ,'Loreum ipsim'), 
('huddersfield', 'leeds' ,'Loreum ipsim'), 
('liverpool', 'manchester' ,'Loreum ipsim'), 
('merseyside', 'manchester' ,'Loreum ipsim'), 
('leicester', 'birmingham*nottinghamshire' ,'Loreum ipsim'), 
('bradford', 'leeds' ,'Loreum ipsim'), 
('wolverhampton', 'birmingham*lichfield*nottinghamshire' ,'Loreum ipsim'), 
('dudley', 'birmingham*lichfield*nottinghamshire*hemel-hempstead*hertfordshire*slough' ,'Loreum ipsim'), 
('luton', 'maidenhead' ,'Loreum ipsim'), 
('preston', 'manchester' ,'Loreum ipsim'), 
('sunderland', 'newcastle*middlesbrough*birmingham*lichfield*nottinghamshire' ,'Loreum ipsim'), 
('walsall', 'manchester' ,'Loreum ipsim'), 
('swansea', 'cardiff' ,'Loreum ipsim'), 
('norfolk', 'thetford-forest' ,'Loreum ipsim'), 
('norwich', 'thetford-forest' ,'Loreum ipsim'), 
('hull', 'hull' ,'Loreum ipsim'); 
+0

thanx好友我忘了:S哈哈很多 –

+0

很高興我能幫上忙。 –

3

只要有一個VALUES

Insert into table (..) VALUES (...),(...),... 

不要重複VALUES關鍵字

1

您不需要重複字值

從使用VALUES語法可以插入多行http://dev.mysql.com/doc/refman//5.5/en/insert.html

INSERT語句。至 做到這一點,包括列值的多個列表,每列列表括在括號內的 並用逗號分隔。例如:INSERT INTO tbl_name(a,b,c)VALUES(1,2,3),(4,5,6),(7,8,9);其中,