Use query results from a SQL query to perform another SQL query with a table in database

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?

Hey @bnham could you post a screenshot of both your queries and how your resulting data (sql_query.data) is formatted? Also, do you happen to be using a Query JSON with SQL Resource?