I am new to sql .please help me with this .
the following sql statement works when i use like this
Dim' CmdStr As String = "insert into table1(id,name,ref,amount) select id,name,ref,amount from table where name = A"
I want to copy rows from one table into multiple tables
Dim CmdStr As String
CmdStr = "insert into table2 (id,name,ref,amount) select id,name,ref,amount from table where name = A"
CmdStr & = "insert into table2 (id,name,ref,amount) select id,name,ref,amount from table where name = B"
CmdStr &="insert into table3 (id,name,ref,amount) select id,name,ref,amount from table where name = C"
CmdStr &="insert into table4 (id,name,ref,amount) select id,name,ref,amount from table where name = d"
Thanks in advance