0

How can I set Column name as 'call'? I tried:

create table Reports(
  id int not null,
  state int not null,
  call varchar(255),
  primary key(id)
);

call with brackets [call] does not work. How Can I do it?

심시은
  • 339
  • 1
  • 5
  • 21
  • 1
    Fix your column name! Don't use reserved words for identifiers. – Gordon Linoff May 02 '19 at 01:07
  • @GordonLinoff I understand that this is not a good case, but is it impossible? – 심시은 May 02 '19 at 01:11
  • 1
    See [this answer](https://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks-in-mysql) more explanation. From the perspective of someone using your schema having keyword-conflicting table or column names is *extremely annoying* and should be avoided whenever possible. `[call]` is SQL Server notation, different from MySQL. – tadman May 02 '19 at 01:13
  • 1
    Use quoted identifiers. https://dev.mysql.com/doc/refman/8.0/en/identifiers.html. For mysql, this is a back-tick character. – Tim May 02 '19 at 01:15
  • @tadman You are right. I'm that someone who using other's schema... backtick works. Thank you – 심시은 May 02 '19 at 01:23

0 Answers0