Combining data with different columns
suggest changeSELECT name, caption as title, year, pages FROM books
UNION
SELECT name, title, year, 0 as pages FROM movies
When combining two result sets with different columns, supply each missing column with a default value. The columns are matched by position, not by name.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents