1IF COL_LENGTH('<table_name>', '<column_name>') IS NULL
2BEGIN
3 --column doesnot exists, so, add column here
4 ALTER TABLE <table_name> ADD <column_name> BIT NOT NULL DEFAULT(0)
5END
1* Using the below query, You can check whether the table1 has a column named "id"
2
3SHOW COLUMNS FROM table1 LIKE 'id'