What SQLite column name can be/cannot be?

前端 未结 5 1387
迷失自我
迷失自我 2020-12-15 03:05

Is there any rule for the SQLite\'s column name?

  • Can it have characters like \'/\'?
  • Can it be UTF-8?
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 03:52

    Except for placing "illegal" identifier names between double quotes "identifier#1", [ before and ] after works as well [identifire#2].

    Example:

    sqlite> create table a0.tt ([id#1] integer primary key, [id#2] text) without rowid;
    sqlite> insert into tt values (1,'test for [x] id''s');
    sqlite> select * from tt
       ...> ;
    id#1|id#2
    1|test for [x] id's
    

提交回复
热议问题