Try this:
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'your_schema' AND
TABLE_NAME = 'table2' AND
COLUMN_NAME NOT IN (
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'your_schema' AND
TABLE_NAME = 'table1');
The above query returns the column names of table2
not present in table1
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments