我正在尝试学习SQL / databricks平台,并且在笔记本中使用with子句时遇到了问题。
我正在尝试遵循本教程。不确定我在做什么错,但我认为使用'union'与我有关系,任何技巧都将不胜感激。 https://www.essentialsql.com/introduction-common-table-expressions-ctes/
with orgsrc
as
(
SELECT *
FROM vw_customers
UNION
SELECT *
FROM vw_customers_merge
)
我遇到以下错误:
Error in SQL statement: ParseException: mismatched input '<EOF>' expecting {'(', 'SELECT', 'FROM', 'DESC', 'VALUES', 'TABLE', 'INSERT', 'DESCRIBE', 'MAP', 'MERGE', 'UPDATE', 'REDUCE'}(line 13, pos 1)
答案 0 :(得分:0)
尝试这样的事情:
WITH orgsrc AS (
SELECT *
FROM vw_customers
UNION
SELECT *
FROM vw_customers_merge
)
SELECT * FROM orgsrc
一些提示:
*
UNION ALL
UNION