Hello, I have SQL query named 'sql_query' and I would like to use the results of this query to reference it in another SQL query. I tried doing this but I cannot use the result.
SELECT s.field1, t.field2
FROM {{sql_query.data}} s
INNER JOIN (SELECT t.field1, t.field2
FROM table1 t)
ON s.field1 = t.field1
table1 is a table from a database, and field1 is referencing the same field from sql_query and table1. This gives error message "syntax error at or near "$1"", so it looks like I cannot use the data from sql_query. Any way for this to work?