I would like to combine two select queries with UNION
.
How can I use the result from the first SELECT
in the second SELECT
?
(SELECT carto_id_key FROM table1
WHERE tag_id = 16)
UNION
(SELECT * FROM table2
WHERE carto_id_key = <the carto_id result from above> )