on the docs says:
UNION effectively appends the result of query2 to the result of query1 (although there is no guarantee that this is the order in which the rows are actually returned). Furthermore, it eliminates duplicate rows from its result, in the same way as DISTINCT, unless UNION ALL is used.
But it doesn’t specify what criteria is used in the underthehood DISTINCT. Is it DISTINCT based on the pks? based on all columns from the query?
What is the criteria used by this underthehood DISTINCT of the UNION to eliminate the repeated rows?
1