我在项目中用到存储过程,大概做了个例子,像下面这样的
A表有name, password, email几个字段
C表有phone,address字段
B表有id,name,password,email,phone,address字段
我现在想把A表和C表查出的数据,插入到B表,用存储过程写出来,不知道该怎么写。求大神解答。
A表和C表不能用联合查询查出来。
A表有name, password, email几个字段
C表有phone,address字段
B表有id,name,password,email,phone,address字段
我现在想把A表和C表查出的数据,插入到B表,用存储过程写出来,不知道该怎么写。求大神解答。
A表和C表不能用联合查询查出来。
SELECT A.NAME,A.PASSWORD,A.EMAIL,C.PHONE,C.ADDRESS FROM A,C
create table tmp_a as
select rownum ida,name, password, email
from A;create table tmp_b as
select rownum idb,phone,address
from B;insert into C
select name, password, email,phone,address
from tmp_a,tmp_b
where ida=idb;