Received: by 10.150.88.9 with SMTP id l9mr809018ybb.15.1257610769559; Sat, 07 Nov 2009 08:19:29 -0800 (PST)Date: Sat, 7 Nov 2009 08:19:29 -0800 (PST)X-IP: 204.52.177.2User-Agent: G2/1.0X-Google-Token: 1t8lJwwAAABMInQOZGHdh_P2xNmd7LrWX-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe)Message-ID: <697edc08-533e-454b-8df6-f280f960c866@u13g2000vbb.googlegroups.com>Subject: String problemFrom: Ninja Li To: “Kdb+ Personal Developers” X-Google-Approved: charlie@kx.com via web at 2009-11-07 16:51:27Hi, I am having issue with processing a string that has space inbetween, for example “Hong Kong”. I would like to run a query such asthe following: select sym_type from mytable where sym_type in USA
EUHong Kong
How can I make the above query succeed? Thanks in advance. Nick
`$“HONG KONG”
2009/11/7 Ninja Li <nickli2000@gmail.com>
Hi,
?I am having issue with processing a string that has space in
between, for example “Hong Kong”. I would like to run a query such as
the following:? select sym_type from mytable where sym_type in
USA
EUHong Kong
? How can I make the above query succeed?
? Thanks in advance.
? Nick
enter it as a char vector and cast to a symbol
q)`$(“USA”;“EU”;“Hong Kong”;“”) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
USA
EUHong Kong
q)USA
EU,($"Hong Kong"),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
USA
EUHong Kong
e.g.
select sym_type from mytable where sym_type in?`$(“USA”;“EU”;“Hong Kong”;“”)
if you use the 2nd example, make sure you wrap the symbols with () to avoid the , being interpreted as a constraint separator in the where clause.
i.e.
select sym_type from mytable where sym_type in (USA
EU,($"Hong Kong"),
)