參考網址:痞客邦
SQL指令–mySQL 檢查欄位是否存在 (MySQL–check which column exists in table)
SELECT count(*) FROM information_schema.columns WHERE table_schema='<Database Name>' AND table_name = '<Table Name>' AND column_name = '<Column Name>'
results as below:
0 if the <Column Name> doesn't exist;
1 otherwise.