2

I have set a column name to "group", which turned out to be a reserved word. Now I try to change the name to "group_code", but I get an error. I try:

ALTER TABLE task_values CHANGE group group_code VARCHAR(40) NOT NULL;

and

ALTER TABLE task_values CHANGE 'group' group_code VARCHAR(40) NOT NULL;

but both fail, I get "No such element" error. Please help

alwbtc
  • 28,057
  • 62
  • 134
  • 188

1 Answers1

2

You will need to use backticks around group which, as you said, is a mysql reserved keyword

ALTER TABLE task_values CHANGE `group` group_code VARCHAR(40) NOT NULL;
Fabio
  • 23,183
  • 12
  • 55
  • 64