Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLUNION vs UNION ALLSingle-choice MCQ

What determines the column names and data types of a UNION ALL result when the two SELECTs differ?

SELECT id AS x, NULL AS note FROM a UNION ALL SELECT id, 'hello' AS note FROM b;