Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copy data from one table to another

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I want to copy some data from one table (orderpaymentno) to another table (order) in mySQL. The two tables are not identical.

I also have to predefine some data in the new table. This is the SQL query I have tried out but it doesn�t work.

Can anyone help me correcting the SQL query ?
[ February 19, 2007: Message edited by: Jeppe Fjord ]
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the INSERT INTO clause, you can only put column names.
If the values 2, 2, 'Afdeling (I understand that!)' and 2 need to be fixed values, then you must put their column name in the INSERT INTO clause, and their value in the SELECT clause:



Regards, Jan
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic