问题
The inner query is giving problem.
MERGE INTO evaluation_fact eval_fact
USING (SELECT $27 tim_id , $28 dt_id , $13 w_id
FROM @REPORTING_MERGE_STAGE/reporting-data-ingest/Evaluation-IT.csv) csv_data
ON eval_fact.w_id = csv_data.w_id
WHEN matched THEN
UPDATE
SET tim_id = (SELECT day_id FROM rom dates_dim d
WHERE d.day_id = csv_data.tim_id),
dt_id = (SELECT time_id FROM time_dim t
WHERE t.time_name = csv_data.dt_id)
WHEN NOT matched THEN
INSERT (tim_id, dt_id)
VALUES ( (SELECT day_id FROM dates_dim d
WHERE d.day_id = csv_data.tim_id),
(SELECT time_id FROM time_dim t
WHERE t.time_name = csv_data.dt_id) );
Note : I am adding this question again because for older one I didn't have access to edit. Kindly excuse.
来源:https://stackoverflow.com/questions/61604487/unsupported-subquery-type-cannot-be-evaluated