2

我在 SQL 表中有一个名为的列Date,但不幸的是,此查询引发了错误:

select Author, Date, Text from Tiny.Comment

我试图用or转义Date关键字,但这对我没有用。[Date]'Date'

4

2 回答 2

2

在 InterSystems Caché SQL 中有点不同:您需要使用双引号来转义关键字:

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'
于 2017-11-03T16:31:32.737 回答
2

您还可以使用 %STRING 函数,例如:

SELECT ID, Super 
FROM %Dictionary.CompiledClass 
WHERE %STRING(Super) %STARTSWITH %STRING('Base.%')
于 2017-12-04T18:44:16.360 回答