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
Related Q & A:
- How to insert data in db using jsp?Best solution by Yahoo! Answers
- How to add primary key from multiple table as a foreign key in a table in sql server 2008?Best solution by stackoverflow.com
- How to insert data into database in electron?Best solution by Stack Overflow
- How to insert into table in XML which has more than table?Best solution by Stack Overflow
- How to write SQL statement with dynamic where clause?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.