2

I have a column named Date in SQL table, but unfortunately this query throws an error:

select Author, Date, Text from Tiny.Comment

I've tried to escape the Date keyword with [Date] or 'Date' but this never worked for me.

ZitRo
  • 1,163
  • 15
  • 24

2 Answers2

2

In InterSystems Caché SQL it's a bit different: you need to use double quotes symbol to escape a keyword:

select Author, "Date", Text from Tiny.Comment

This will also work:

select Author, myTable."Date", Text from Tiny.Comment as myTable where "Date"='2017-11-03 11:09:28'
ZitRo
  • 1,163
  • 15
  • 24
2

You can also use %STRING function like:

SELECT ID, Super 
FROM %Dictionary.CompiledClass 
WHERE %STRING(Super) %STARTSWITH %STRING('Base.%')
drakut
  • 21
  • 5