Column Name same as Variable

Hi,
I stumbled upon a strange problem where I will need help.

If I have a table with column name same as name of a variable which I am using as a matching condition in my query,I dont get the matching row.

Rather I get all rows available in table

d1 : nameage!(MethuselahJared`Noah; 969 962 950)

t1: flip d1

name:`Jared

select from t1 where t1[`name] = name

It gives all the rows of table instead of one matching row.

Here name of column is “name” and name of variable used as matching condition is also “name”

Regards,

Harsh

Hi Harsh, You can get around this by multiple methods, here are three: // define table q)d1:nameage!(MethuselahJaredNoah; 969 962 950) q)t1:flip d1 q)name:Jared // access the name value by grabbing it from it’s dictionary (root) q)select from t1 where name=(. name) name age --------- Jared 962 // use lambdas and pass name in as param q){ select from t1 where name=x}[name] name age --------- Jared 962 // don’t use the columns names q)namep:name q)select from t1 where name=namep name age --------- Jared 962 HTH, Sean