How could I want to add a column if not exist. I tried this code:
IF EXISTS( SELECT NULL
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'forwind.measuringdata_fino_10_00000000'
AND table_schema = 'forwind'
AND column_name != 'F1_USA(40)_u') THEN
ALTER TABLE `forwind.measuringdata_fino_10_00000000` ADD `F1_USA(40)_u` FLOAT NOT NULL default '0';
END IF;
but I get the following error:
Error Code: 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 NULL FROM INFORMATION_SCHEMA.COLUMNS
Good for me if somebody know an other solution!