我正在测试ETL加载,并且想要创建一个结合了许多规则的临时表,这样我就可以对这个临时表和实际加载的表做一个减号。 我已经尝试了各种各样的事情但是仍然收到同样的消息,说明" FROM关键字未找到预期的位置" 我的导师不在度假,如果有人可以给我一些帮助,我会很感激。
Create table tbl_HT_CUST_PHNUM_TEMP as
Select a.CONT_ID as CONT_ID,
a.TELEPHONE_NO as TELEPHONE_NO,
ROW_ID IS NULL,
STATUS_ID IS NULL,
SystemTableID IS NULL,
INITIAL_POPULATION_TS as INITIAL_POPULATION_TS,
BUSINESS_DATE_EXT as BUSINESS_DATE_EXT,
UPDATE_DATE_TIME as UPDATE_DATE_TIME,
DATE_ENDED as DATE_ENDED
CUSTOMERMAPPINGKEY IS NULL
from <schema>.tbl_HT_CUST_PHNUM a;
答案 0 :(得分:0)
您的as
与is
混淆了。假设您的数据库支持create table as
,那么我怀疑您需要这样的内容:
Create table tbl_HT_CUST_PHNUM_TEMP as
Select a.CONT_ID as CONT_ID,
a.TELEPHONE_NO,
NULL as ROW_ID,
NULL as STATUS_ID,
NULL as SystemTableID,
a.INITIAL_POPULATION_TS,
a.BUSINESS_DATE_EXT,
a.UPDATE_DATE_TIME,
a.DATE_ENDED,
NULL as CUSTOMERMAPPINGKEY
from <schema>.tbl_HT_CUST_PHNUM a;
请注意,您不需要as
来指定直接来自表格的列名。