Hello,
I want to create a table with a name taking from a user-defined variable. The following code doesn't seem to work (I get a MYSQL syntax error near CREATE TABLE line)
Thanks in advance for the help
SET @ratingsNewTableName = CONCAT('ratings_', 'anotherString');
CREATE TABLE IF NOT EXISTS @ratingsNewTableName (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`user_id` INT(11) NOT NULL,
`movie_id` INT(11) NOT NULL,
`rate` DOUBLE NOT NULL,
`date` DATE NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;