0

I am trying to create a table with a fixed prefix and a variable, something similar as below.

set @id=10;
CREATE TABLE Exam_@id(
    name varchar(25) not null,
    roll int(11) not null
    )

But mysql throws some error. can any one suggest me the right way to do?(I am working in phpmyadmin directly).

-thanks

3
  • or refactor select .. from exam where exam_id=10 Commented Jul 20, 2015 at 12:47
  • What is the error that it throws? Commented Jul 20, 2015 at 12:48
  • the error message is #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 '@id( name varchar(2) not null )' at line 1 Commented Jul 20, 2015 at 12:50

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.