Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- copy data from one table to another table
March 4, 2011, 2:39 am
rate this thread
The footprint of the tables is different. Here is the INSERT I am
trying to use.
An error is returned, "SQL Error (1136); Column count doesn't match
value count at row 1.
I've run the SELECT without the INSERT line and it does select the
data I want to copy.
Comparing the fields in "births"with the fields defined by the SELECT,
The only field that is missing is the primary key (birthid), which I
assumed the INSERT would fill in..
INSERT IGNORE INTO births
NewspaperKey AS newspaperid,
IF(Month < 10, CONCAT("0",Month), Month) ,
IF(Day < 10, CONCAT("0", Day), Day) ) AS paperdate,
Page AS page,
Col AS col,
FatherFirst AS fatherfirst,
FatherMiddle AS fathermiddle,
MotherFirst AS motherfirst,
MotherMiddle AS mothermiddle,
MotherMaiden AS mothermaiden,
First AS childfirst,
Middle AS childmiddle,
Last AS childlast,
DateOfBirth AS dob,
Comments AS comment
WHERE Year < 1890;
Re: copy data from one table to another table
This is a PHP newsgroup (hence the "php" in it's name).
Try a newsgroup related to the database you're using.
Remove the "x" from my email address
JDS Computer Training Corp.
- » Sort using utf characters in mysql or php ? best solutions...
- — Previous thread in » PHP Scripting Forum