nov*_*ice 1 sql oracle oracle10g
我想创建一个表来存储来自两个不同表的值;
从表1开始:cust_id(varchar2),invoice_amt(float)
从表2:cust_id(来自表1),payment_date
我的桌子应该有3个字段:
cust_id, invoice_amt, payment_date
Run Code Online (Sandbox Code Playgroud)
我尝试了以下,这显然是错误的.
create table temp1 as (
select table_1.cust_id, table_1.invoice_amt, table_2.payment_date
from table_1@dblink, table_2@dblink)
Run Code Online (Sandbox Code Playgroud)
您宝贵的建议将会有很大帮助.
create table temp1 as (
select
table_1.cust_id,
table_1.invoice_amt,
table_2.payment_date
from
table_1@dblink,
table_2@dblink
where
table_1.cust_id = table_2.cust_id
)
Run Code Online (Sandbox Code Playgroud)
我不是神谕,但那应该做你想要的(虽然未经测试).