Oracle table column name with space

后端 未结 6 1259
北荒
北荒 2020-12-06 09:24

Is it possible to create a table with column name containing space? If so how can I create and use it?

6条回答
  •  有刺的猬
    2020-12-06 09:53

    Yes, it's possible. You just have to be sure to quote the column name. For instance:

    CREATE TABLE Fubar ("Foo Bar" INT);
    INSERT INTO Fubar VALUES (1337);
    SELECT "Foo Bar" FROM SpaceMonster
    

    Even though it's possible, it doesn't make it a good idea. You'll probably save yourself from a lot of pain if just replace all you spaces with underscores.

提交回复
热议问题