Skip to content
Advertisement

How to create a Temporary table in Bigquery

I’ve been trying to build up a Temporary Table with both CREATE TEMPORARY TABLE and WITH statements in the following query. So far I couldn’t get any positive result and I don’t know what’s going on. In last line, the error alert says: “Syntax error: Expected “(” or “,” or keyword SELECT but got end of script at [28:62]”

Advertisement

Answer

As suggested by @Paul, You get this error because a CTE (i.e. the WITH statement) is only part of a query. It needs to be followed by another statement, usually a SELECT. You can also refer to this StackOverflow question where the same error has been discussed.

You can try the below code which I have modified accordingly to resolve the error.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement