我想创建一个表来存储来自两个不同表的值;
从表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)
您宝贵的建议将会有很大帮助.
我在Oracle 10g中有一个包含以下字段的表.
表格1
account_no | tracking_id | trans_amount
每个account_no可以有多个跟踪ID和交易金额.
如何查询account_no的重复条目,其中跟踪介于1和1000之间,以及相应的trans_amount?
非常感谢您的帮助,
新手.
我有两个包含以下字段的表:
table1 : OTNAME table2 : SNCODE, description_text
我正在尝试将 table2 的两列添加到 table1 并更新列。我的查询是:
alter table table1 add sncode integer
alter table table1 add description_text varchar2(30)
update table1 set
sncode,description_text = (SELECT sncode, description_text
FROM table2, table1
WHERE SUBSTR (otname, INSTR (otname,'.', 1, 3)
+ 1,
INSTR (otname, '.', 1, 4)
- INSTR (otname,'.', 1, 3)
- 1)
= sncode)
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:ORA 00927 - Missing Equal to Operator,指向我的更新语句的第二行。感谢有人能指出我正确的方向。
问候,
新手