BigQuery Syntax error: Expected keyword ALL or keyword DISTINCT but got keyword SELECT
Problem 🔍
UNION Keyword is not supported in Bigquery
Keyword | BigQuery Equivalent |
UNION | UNION DISTINCT |
UNION ALL | UNION ALL |
Solution 💡
Replace UNION Keyword with UNION DISTINCT
Example: Rewrite the below query,
SELECT * FROM Sales_Asia UNION SELECT * from Sales_Europe;
to
SELECT * FROM Sales_Asia UNION DISTINCT SELECT * from Sales_Europe;
This should fix the issue !
mCollins
posted on 20 Feb 19Enjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds
Post Comment