I was running some SQL queries in a siteground site. Where I have some queries like this:
ALTER TABLE `tbl_sales` ADD IF NOT EXISTS `employee_id` INT NULL DEFAULT NULL AFTER `customer_id`;
But when I run run the SQL I am getting this error.
#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 NOT EXISTS
employee_id
INT NULL DEFAULT NULL AFTERcustomer_id
' at line 1
But the same SQL I am running in my local and having no issue. I guess it is a MySQL version issue or something, can you please help me to solve this problem?
Here is the server information of my local:
Server type: MariaDB Server version: 10.1.22-MariaDB - mariadb.org binary distribution
And in SiteGround, it is:
Server type: MySQL Server version: 5.7.25-28-log - Source distribution
Thanks in advance!