【发布时间】:2019-09-18 15:51:21
【问题描述】:
使用 BigQuery,我想删除 ID 为 Common Table Expression 或 with 的行
这是我的查询:
WITH
redundant AS (
SELECT
id,
MAX(updated_at) AS updated_at,
COUNT(*) AS counter
FROM
t1
GROUP BY
id
HAVING
counter >= 2)
DELETE
FROM
t1
WHERE
id IN (redundant.id)
AND updated_at NOT IN (redundant.updated_at )
我预计这些行将被删除,但我收到此错误消息:Syntax error: Expected "(" or keyword SELECT but got keyword DELETE at [13:1]
【问题讨论】:
标签: mysql google-bigquery sql-delete with-statement