- The label on the token is called "Name", not "Col"
- When comparing a column to a string value, the string needs to be enclosed in single quotation marks within the query (WHERE [Name] == 'A'), so you need to add those to the query string in front of and after the label value.
- You need to convert the number value from "token.Num" to a string before you can insert it into the query like this (string.fromNum(token.Num))
- You only write WHERE once, then write multiple checks separated by AND or OR
Table result = Table.query("SELECT * FROM Test1 \
WHERE [Name] = '"+token.Name+"' AND [Num] = "+string.fromNum(token.Num)+"");
With all that said, values that you want to compare columns to can more easily be passed in via the $-syntax. Inserting the label directly into the string is only needed if it represents a column name or SQL clause.
Table result = Table.query("SELECT * FROM Test1 WHERE [Name] = $1 AND [Num] = $2", token.Name, token.Num);When the query is run, $1 will be replaced by the first value that is passed in after the query, $2 by the second and so on.