Add extra columns as null for the table having less columns like
Select Col1, Col2, Col3, Col4, Col5 from Table1
Union
Select Col1, Col2, Col3, Null as Col4, Null as Col5 from Table2
More Related Contents:
- Join vs. sub-query
- Find records from one table which don’t exist in another
- How do I update if exists, insert if not (AKA “upsert” or “merge”) in MySQL?
- How to use GROUP BY to concatenate strings in MySQL?
- Natural Sort in MySQL
- Best way to test if a row exists in a MySQL table
- MySQL Insert query doesn’t work with WHERE clause
- Comparing date ranges
- Fulltext Search with InnoDB
- Rewriting mysql select to reduce time and writing tmp to disk
- How do I convert from BLOB to TEXT in MySQL?
- Which SQL query is better, MATCH AGAINST or LIKE?
- Maintaining order in MySQL “IN” query
- MySQL: What is a reverse version of LIKE?
- Select TOP X (or bottom) percent for numeric values in MySQL
- MySQL select where column is not empty
- MySQL: GROUP_CONCAT with LEFT JOIN
- Hamming distance on binary strings in SQL
- Is it possible to have a default parameter for a mysql stored procedure?
- Renaming foreign-key columns in MySQL
- How to convert from varbinary to char/varchar in mysql
- MySQL GROUP BY behavior
- How to get rid of “Error 1329: No data – zero rows fetched, selected, or processed”
- Update multiple rows with one query?
- How to change string date to MySQL date format at time of import of CSV using MySQL’s LOAD DATA LOCAL INFILE
- How important are lookup tables?
- how to use LIKE with column name
- How to implement a Keyword Search in MySQL?
- In SQL how do I get the maximum value for an integer?
- Get the first and last date of next month in MySQL