我正在尝试使用 CTE 和 Row_number() 从表中删除任何重复的行。我正在研究 Google SQL。
我尝试了不同的方法,但仍然收到此错误消息:
Expected tokens [EOF]. Found token [CTE] (Line: 5, Column: 6)
Error parsing script sql.
我在这里错过了什么吗?
SELECT date, time, location,
Row_number() OVER (PARTITION BY date, time, location ORDER BY date, time, location) AS row,
FROM student_table
WITH CTE AS
(SELECT date, time, location,
Row_number() OVER (PARTITION BY date, time, location ORDER BY date, time, location) AS row,
FROM student_table
)
DELETE FROM CTE where row > 1
感谢任何建议或意见
谢谢!