0
我想將具有特定user_id的日誌數據移動到Redshift上的新表。我已經開始與WITH
塊like玩:使用Redshift將數據從一個表移動到另一個表
WITH moved_rows AS (
DELETE FROM sensor_log_enable
USING sensor_log_disable
WHERE sensor_log_enable.user_id
IN (16,17,18)
RETURNING sensor_log_enable.*
)
INSERT INTO sensor_log_disable
SELECT * FROM moved_rows;
但紅移不喜歡它。
ERROR: syntax error at or near "DELETE"
LINE 2: DELETE FROM active_connections
紅移似乎並不包括在DELETE
塊WITH
。那麼最好的策略是什麼? 然後INNER JOIN
或LEFT OUTER JOIN
與DELETE
?
謝謝John爲您解答。 – Mio