【发布时间】:2017-11-03 16:31:32
【问题描述】:
我在 SQL 表中有一个名为 Date 的列,但不幸的是这个查询抛出了一个错误:
select Author, Date, Text from Tiny.Comment
我尝试使用 [Date] 或 'Date' 转义 Date 关键字,但这对我来说从来没有用过。
【问题讨论】:
标签: intersystems-cache intersystems
我在 SQL 表中有一个名为 Date 的列,但不幸的是这个查询抛出了一个错误:
select Author, Date, Text from Tiny.Comment
我尝试使用 [Date] 或 'Date' 转义 Date 关键字,但这对我来说从来没有用过。
【问题讨论】:
标签: intersystems-cache intersystems
在 InterSystems Caché SQL 中有点不同:您需要使用 double quotes 符号来转义关键字:
select Author, "Date", Text from Tiny.Comment
这也可以:
select Author, myTable."Date", Text from Tiny.Comment as myTable where "Date"='2017-11-03 11:09:28'
【讨论】:
您还可以使用 %STRING 函数,例如:
SELECT ID, Super
FROM %Dictionary.CompiledClass
WHERE %STRING(Super) %STARTSWITH %STRING('Base.%')
【讨论】: