Can I directly join SELECT statements without using a view?

Is it possible to do the following without creating a representation between them? That is, simply attaching these SELECT directly?

CREATE VIEW temp_first AS SELECT MIN(DATE) AS mindate,id FROM mytable GROUP BY id # SELECT *, t.mindate FROM aggregate_analysis a JOIN temp_first t ON t.id = a.id WHERE (.... ) ORDER BY mindate DESC 
+4
source share
1 answer

You should be able to replace the view link in the selection with the sub query / sub selection.

Take a look

Sort of

 SELECT *, t.mindate FROM aggregate_analysis a JOIN ( SELECT MIN(DATE) AS mindate, id FROM mytable GROUP BY id ) as t ON t.id = a.id WHERE (.... ) ORDER BY mindate DESC 
+4
source

All Articles