How does the count work if there is a union in the query?
I've tried this but it didn't work giving this error: Every derived table must have its own alias
(select cod from table1 UNION cod from table2)
I've also tried this but didn't work:
(select cod from table1 UNION select cod from table2)
Thanks in advance