0
I need to add some columns to my mysqli
that according to the wamp
is the version 5.7.26 because I am doing the integration with paid market, however, I realize that regardless of the way I create my table, soon after adding the 'date' column of type date, I get the following error:
1064 - you have a syntax error in your SQL next to ') NOT NULL AFTER
data
on line 1.
And the indicated command that points to this error is as follows:
ALTER TABLE `fatura` ADD `valor` DOUBLE(255) NOT NULL AFTER `data`;
I am using the graphical interface to add columns, I don’t understand how it can be possible that an error occurs by typing SQL commands, as if I were running them manually
Here is my SQL
DROP TABLE IF EXISTS `fatura`;
CREATE TABLE IF NOT EXISTS `fatura` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_user` varchar(20) NOT NULL,
`ref` varchar(255) NOT NULL,
`forma` varchar(255) NOT NULL,
`data` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
COMMIT;
ALTER TABLE fatura ADD valor DOUBLE NOT NULL AFTER data;
https://www.db-fiddle.com/f/sWnCukrctrWnAnhiggS3vi/0– Augusto Vasques
thank you, gave it right :)
– John Jones