SELECT
store_seq.NEXTVAL AS STORE_ID,
DIST_WRK_STR.*
FROM
(
SELECT DISTINCT
WRK_HHT.COUNTRY_ID AS COUNTRY_ID,
CASE
WHEN WRK_HHT.LOCAL_STORE_CD IS NULL THEN
WRK_HHT.TMP_STORE_CD
ELSE
WRK_HHT.LOCAL_STORE_CD
END AS LOCAL_STORE_CD,
CASE
WHEN WRK_HHT.LOCAL_STORE_CD IS NULL THEN
1
ELSE
0
END AS TMP_SLC_FLG,
SYSDATE,
SYSDATE
FROM
WRK_HHTLOGDATA WRK_HHT
LEFT OUTER JOIN
MST_STORE MST_STR
ON
WRK_HHT.COUNTRY_ID = MST_STR.COUNTRY_ID
AND
MST_STR.STORE_LOCAL_CD =
(
CASE
WHEN WRK_HHT.LOCAL_STORE_CD IS NULL THEN
WRK_HHT.TMP_STORE_CD
ELSE
WRK_HHT.LOCAL_STORE_CD
END
)
WHERE
MST_STR.STORE_ID IS NULL
AND
(
WRK_HHT.LOCAL_STORE_CD IS NOT NULL
OR
WRK_HHT.TMP_STORE_CD IS NOT NULL
)
AND
WRK_HHT.COUNTRY_ID = ncountry_id
AND
WRK_HHT.LOAD_ID = nload_id
) DIST_WRK_STR
我得到的錯誤作爲地方DIST_WRK_STR含糊不清的列名*
ncountry_id和nload_id不合格。這可能就是其中之一。 –
你能列出你的表格結構嗎?我們需要知道列名稱才能夠回答您的問題。但是,如果你有資格獲得所有的領域,那麼你就可以解決問題 –