我有我的脚本来创建3个视图,并将它们与完整的外部连接和联合所有查询相结合。但是当我运行这个查询时,我得到了一个缺少关键字的错误;各个视图对每个select语句都工作正常。
我的查询有什么问题?
CREATE OR replace force VIEW "VW_RANGE_REPORT_Jul2023"
WITH live_str AS ( SELECT ------- from ---------- ),
pend_str AS ( SELECT ----------from -----------),
pend_only AS ( Select --------from ---------)
SELECT
NVL(lp.StoreNumber,pp.StoreNumber) AS StoreNumber,
NVL(lp.StoreName,pp.StoreName) AS StoreName,
lp.floorplanDBkey AS LiveFLRkey,
lp.floorplanName As LiveFloorplanName,
lp.FLRPENDDATE As LiveFLRPendDate,
lp.FLRLIVEDATE AS LiveFLRLiveDate,
lp.PlanogramKey AS LivePOGKey,
lp.PlanogramName AS LivePOGName,
lp.PlanogramPendingDate AS LivePOGPendDate,
lp.PlanogramLiveDate AS LivePOGLiveDate,
pp.floorplanDBkey AS PendFLkey,
pp.floorplanName As PendFloorplanName,
pp.FLRPENDDATE As PendFLRPendDate,
pp.FLRLIVEDATE AS PendFLRLiveDate,
pp.PlanogramKey AS PendPOGKey,
pp.PlanogramName AS PendPOGName,
pp.PlanogramPendingDate AS PendPOGPendDate,
pp.PlanogramLiveDate AS PendPOGLiveDate
FROM live_str lp
FULL OUTER JOIN pend_str pp ON pp.PlanogramVersionKey = lp.PlanogramVersionKey
AND pp.floorplanversionkey = lp.floorplanversionkey
AND pp.StoreNumber = lp.StoreNumber
And pp.StorrDBKEy=lp.storedbkey
UNION ALL
SELECT po.StoreNumber,
po.StoreName,
NULL AS LiveFLRKey,
NULL AS LiveFloorplanName,
NULL AS LiveFLRPendDate,
NULL AS LiveFLRLiveDate,
NULL AS LivePOGKey,
NULL AS LivePOGName,
NULL AS LivePOGPendDate,
NULL AS LivePOGLiveDate,
po.FloorplanDBKey AS PendFLKey,
po.FloorplanName as PendFloorplanName,
po.FLRPENDDATE as PendFLRPendDate,
po.FLRLIVEDATE as PendFLRLiveDate,
po.PlanogramKey AS PendPOGKey,
po.PlanogramName AS PendPOGName,
po.PlanogramPendingDate AS PendPOGPendDate,
po.PlanogramLiveDate AS PendPOGLiveDate
FROM pend_only po
ORDER BY 1,3;
字符串
1条答案
按热度按时间wn9m85ua1#
这显然是错误的;我不知道你想用这段代码做什么:
字符串
也许你想做这样的事情?
型
另外,您是否确定要将视图名称括在双引号中并在其名称中使用混合字母大小写?你必须这样引用它--使用双引号和匹配字母大小写--每次你使用它。如果我是你我就
型