Table or column name cannot start with numeric?

后端 未结 2 788
甜味超标
甜味超标 2020-11-30 06:02

I tried to create table named 15909434_user with syntax like below:

CREATE TABLE 15909434_user ( ... )

It would produced error o

2条回答
  •  孤城傲影
    2020-11-30 06:38

    I'd imagine it's to do with the grammar.

    SELECT 24*DAY_NUMBER as X from MY_TABLE

    is fine, but ambiguous if 24 was allowed as a column name.

    Adding quotes means you're explicitly referring to an identifier not a constant. So in order to use it, you'd always have to escape it anyway.

提交回复
热议问题