I have a kdb table with column name type
and want to select data by a giving type. It's like:
select from table where type=giving_type
it issues an error of : 'type
, because type is a reserved word in q.
Then how to do this?
I have a kdb table with column name type
and want to select data by a giving type. It's like:
select from table where type=giving_type
it issues an error of : 'type
, because type is a reserved word in q.
Then how to do this?
you could use a functional select:
?[`table;enlist (=;enlist `giving_type;`type);0b;()]
Generally you should avoid using kdb reserved words such as "type" as the column name.
In this particular case where the table does have "type" as column name, functional select is the solution.
You can find the functional form of a select query via the parse function:
parse "select from table where type=giving_type"