How to delete a column from a table in MySQL

Given the table created using: CREATE TABLE tbl_Country ( CountryId INT NOT NULL AUTO_INCREMENT, IsDeleted bit, PRIMARY KEY (CountryId) ) How can I delete the column IsDeleted? 9 s 9 ALTER TABLE tbl_Country DROP COLUMN IsDeleted; Here’s a working example. Note that the COLUMN keyword is optional, as MySQL will accept just DROP IsDeleted. Also, … Read more

Check if a temporary table exists and delete if it exists before creating a temporary table

I am using the following code to check if the temporary table exists and drop the table if it exists before creating again. It works fine as long as I don’t change the columns. If I add a column later, it will give an error saying “invalid column”. Please let me know what I am … Read more