3
對不起,如果標題不清楚。基本上我試圖從多個表中選擇某些記錄,然後更新返回記錄的某個列值。Teradata從Select語句更新表
T-SQL實現
UPDATE
CUSTOMERS
SET
LIKES_US = 'Y'
FROM
RESTAURANT REST INNER JOIN CUSTOMERS CUST ON REST.LINK_ID = CUST.LINK_ID
WHERE
REST.REST_TYPE = 'Diner' AND CUST.LIKES_US IS NULL
甲骨文
UPDATE
(SELECT CUST.LIKES_US
FROM CUSTOMERS CUST INNER JOIN RESTAURANT REST ON CUST.LINK_ID=REST.LINK_ID
WHERE REST.REST_TYPE = 'Diner' AND CUST.LIKES_US IS NULL) NEW_CUST
SET
NEW_CUST.LIKES_US = 'Y';
我試圖做同樣的事情在Teradata的,因爲我在Oracle中沒有,但我得到以下錯誤:
Executed as Single statement. Failed [3707 : 42000] Syntax error, expected something like a name or a Unicode delimited identifier or an 'UDFCALLNAME' keyword between the 'UPDATE' keyword and '('.
Elapsed time = 00:00:00.003
STATEMENT 1: Unknown failed.
我在網上尋找解決方案,但沒有運氣。