I want to create a table that stores values from two different tables;
From table 1: cust_id (varchar2), invoice_amt (float)
From table 2: cust_id (from table 1), payment_date
My table should have 3 fields:
cust_id, invoice_amt, payment_date
I tried the following, which is obviously wrong.
create table temp1 as (
select table_1.cust_id, table_1.invoice_amt, table_2.payment_date
from table_1@dblink, table_2@dblink)
Your valuable suggestions will be of great help.
It depends on what you're going to use it for, but I'd be sorely tempted to use a view instead of a table:
The advantage is it always contains the values from the current versions of table_1 and table_2. The disadvantage is that you cannot edit the view (or, if you can, your edits affect the underlying tables as well as the view).
I'm no oracle guy, but that should do what you want (untested, though).
You were close: