Reference questions using temporary tables in Bigquery

When doing more complicated stuff I often use temporary tables for performance:

It works similarly to CTEs, but instead of with results as (..., I write create temp table results as ...

The problem is when referencing SQL question made with temporary tables in another question: create temp table is put somewhere in the middle, but it needs to be on top of the new query, before select statements.

Is it possible to recognize create temp table somehow and always put them on top of the nested queries?

Hi @pkalinowski
Metabase does not support multi-statement queries: - upvote by clicking :+1: on the first post