How do I get the column name of two tables in a single query ?
SELECT column_name
FROM INFORMATION_SCHEMA.COLUMNS
where table_name = 'table_name';
This works for single table. But if I try
SELECT column_name
FROM INFORMATION_SCHEMA.COLUMNS
where table_name = 'table1'
AND
SELECT column_name
FROM INFORMATION_SCHEMA.COLUMNS
where table_name = 'table2';
This throws error.
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS where table_name = 'table2' ' at line 5
Error Code: ER_PARSE_ERROR