column name same as function

Hi,

I have a bunch of splayed tables with a column named last. Unfortunately when I try to include this in a select statement kdb assumes I am trying to use the last function.

Is there a way I can escape the column name so it doesn’t use the last function? Or do I need to rename my columns?

Cheers,

Kefa

I don’t think reserved words are good candidates for column names, but functional forms do work:

q)meta tc | t f a----| -----date| d k | s last| iq)select from tdate k last-----------------2016.06.01 a 1 2016.06.01 b 2 2016.06.01 c 3 q)select last from t'rankq)?[:/tmp/tmpdb/2016.06.01/t;();0b;(enlistlast)!enlistlast]last----1 2 3`

But I would rename columns if I could.

Agreed. You could also look into using .Q.id to ensure validity of column names: http://code.kx.com/wiki/DotQ/DotQDotid

q).Q.id flip col1lastsystem!(a`b;1 2;“xy”)
col1 last1 system1

a    1     x
b    2     y

Terry