数据库 – “日期”作为列名称

前端之家收集整理的这篇文章主要介绍了数据库 – “日期”作为列名称前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一张叫做日历的表.

其列之一被命名为“日期”

当我想选择日期列时,它给出错误ORA-01747即无效的table.column.

select date from calendars

我猜这是因为’date’是pl / sql的保留字.问题是甚至不可能更改列名称

alter table calendars rename column date to date_d

结果是:ORA-00904错误:无效的标识符.

你建议什么

谢谢.

解决方法

你有没有尝试过
select calendars.date from calendars; /* or you could alias "calendars" if you don't want to type so much */

如果这不工作或帮助,是否尝试删除列(也许尝试使用表名前缀calendars.date引用它)?

我也发现这个帖子:How do I escape a reserved word in Oracle?

如果您使用双引号,Oracle似乎会区分大小写

select "date" from calendars;

不一样

select "Date" from calendars;
原文链接:https://www.f2er.com/mssql/75117.html

猜你在找的MsSQL相关文章