我有2个表:with sc1 as (
select owner, object_name, last_ddl_time
from all_objects
where object_type = 'VIEW' and owner = 'SC1'),
sc2 as (
select owner, object_name, last_ddl_time
from all_objects
where object_type = 'VIEW' and owner = 'SC2')
select sc1.object_name, sc1.last_ddl_time from sc1 inner join sc2
on (sc1.object_name = sc.object_name)
where sc1.last_ddl_time > sc2.last_ddl_time;
包含客户端处理数据,operations
包含年龄数据。我想创建新表customers
并在vlookup
到Age
添加新列customers
,但它不起作用:
operations
答案 0 :(得分:0)
您有一些基本的语法错误。没有FROM
子句来指定第一个表,并且INNER JOIN
必须后跟您要加入的表,而不是列。
你说你希望新表名为vlookup
,但你创建的是total
。
CREATE TABLE new_schema.vlookup AS (
SELECT o.id_check, o.id_client, c.age
FROM new_schema.operations AS o
INNER JOIN new_schema.customers AS c ON o.id_client = c.id_client
);