Oracle表列名称带空格 [英] Oracle table column name with space
问题描述
是否可以创建一个列名包含空格的表?如果可以,我该如何创建和使用它?
Is it possible to create a table with column name containing space? If so how can I create and use it?
推荐答案
可能,但不建议这样做.您需要用双引号将列名引起来.
It is possible, but it is not advisable. You need to enclose the column name in double quotes.
create table my_table ("MY COLUMN" number);
但是请注意文档中的警告:
注意:Oracle不建议对数据库使用带引号的标识符 对象名称.这些带引号的标识符被SQL * Plus接受,但是 当使用其他管理数据库的工具时,它们可能无效 对象.
Note: Oracle does not recommend using quoted identifiers for database object names. These quoted identifiers are accepted by SQL*Plus, but they may not be valid when using other tools that manage database objects.
名称将区分大小写,并且每次引用该名称时,都必须用双引号将其引起来:
The name will be case-sensitive, and you wil have to enclose the name in double quotes every time you reference it:
select "MY COLUMN" from my_table;
所以...不,这是我的建议...
So... don't, would be my advice...
这篇关于Oracle表列名称带空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!