How to Copy records/Data from one table to another table
Posted 25 September 2006 - 03:00 AM
INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL1, COL4, COL7 FROM TABLE1
I think I can do in this way, but the problem is the tables are not identical and I need to insert some varibles in the destination table, and a current date, and so on, so in this way I think I cant do it...
From the table I need to take the data I just need some fields, but the others are variables that are in my script..
How can I solve it.... If anybody can give a solution to this issue..
Posted 25 September 2006 - 04:51 AM
But, aren't you able to alter the table you already have to suit your needs ?
Posted 25 September 2006 - 11:29 AM
INSERT INTO TABLE2 (COL1, COL2, COL3, COL4, COL5 ) SELECT COL1, COL4, COL7, CURDATE(), 42 FROM TABLE1
Donations gratefully received
|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users