Why this query doesn’t working:
SELECT name
FROM
(
SELECT name
FROM table1
UNION
SELECT name
FROM table2
) q
It returns nothing, even no error or empty table.
But
SELECT name
FROM table1
UNION
SELECT name
FROM table2
Is ok. It returns table with name field full of rows from two tables.
I know that this query is redundant, but I need to make it work as part of other query.