How to insert data from one table to another?

Help with sql statement - insert data into two table?

  • I am new to sql .please help me with this . the following sql statement works only on one table "insert into table1(id,name,ref,amount) select id,name,ref,amount from table where name = A" How do i use it to insert into multiple tables like this "insert into table2 (id,name,ref,amount) select id,name,ref,amount from table where name = B" "insert into table3 (id,name,ref,amount) select id,name,ref,amount from table where name = C"

  • Answer:

    multiple statements. There is no way to do it in one statement how you have it

Alex Alex at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.