if column exists sql code example
Example 1: Columns Present in a table
DESCRIBE Table_Name;
OR
DESC Table_Name;
Example 2: sql check if column exists
* Using the below query, You can check whether the table1 has a column named "id"
SHOW COLUMNS FROM table1 LIKE 'id'