如果存在,我需要刪除一個表列,但我有一些問題..我不斷收到此錯誤,我不能圖它爲什麼刪除表列如果存在(SQLSTATE [42000]語法錯誤或訪問衝突)
An error occurred when processing the migration:
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'IF EXISTS (SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'my_d' at line 1
這是我的查詢
IF (EXISTS (SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'my_db_Name' AND TABLE_NAME = 'my__table' AND COLUMN_NAME = 'currency_format'))
BEGIN
ALTER TABLE 'my__table' DROP COLUMN currency_format;
END
那麼,該怎麼做,所以我將是AB le執行這個查詢? 謝謝!