Skip to content
Advertisement

Unrecognized name: error in nested query using bigquery standard sql

I am running the query where the inner statement (in this case I use when..case) and it is expected to run the query from the outer statement’s result. But, the result from the outer statement is in string datatype , so I added “as INT64” to solve this. However, the query still throw error “Unrecognized name: (score at [12:33]

Code:

Is there any way to do like keep the query result from outer statement , and then run it in inner statement?

Advertisement

Answer

Do the original query in a derived table, and then use its result column score in the outer query.

You probably need to add a condition too, to make the subquery correlated.

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