Does doing a
SELECT * FROM (SELECT foo.id, bar.name FROM foo LEFT JOIN bar ON bar.foo_id = foo.id)
\--------------- Will this be a temp table? --------------------------/
create the same type of temporary table as declaring a table with # does in a stored procedure? Or does it create a view or perhaps some other magic?
A quick search on temporary tables only showed them being used in stored procedures.
it does yes, but internally only.
you wouldn’t have access to it after the whole query is executed.