Insert into MySQL a huge number of rows, based on subquery... having trouble -
so, trying insert row of none, $country every country exists in table.
it should like
afghanistan, none albania, none andorra, none
... is, in addition provinces listed each country... this:
| zambia | western | | zimbabwe | bulawayo | | zimbabwe | harare | | zimbabwe | manicaland | | zimbabwe | mashonaland central | | zimbabwe | mashonaland east | | zimbabwe | mashonaland west | | zimbabwe | masvingo | | zimbabwe | matabeleland north | | zimbabwe | matabeleland south | | zimbabwe | midlands
this code attempting, failing miserably.
insert countries2 (province,country) values ('none', (select distinct country countries2));
i get
you can't specify target table 'countries2' update in clause
but throwing error:
subquery returns more 1 row
insert countries2 (province,country) select distinct 'none', country countries2
you may want check order of fields !
Comments
Post a Comment