我有一张桌子bb:
bb:([]key1: 0 1 2 1 7; col1: 1 2 3 4 5; col2: 5 4 3 2 1; col3:("11";"22" ;"33" ;"44"; "55"))
Run Code Online (Sandbox Code Playgroud)
如何对字符串进行关系比较?假设我想获得col3小于或等于"33"的记录
select from bb where col3 <= "33"
Run Code Online (Sandbox Code Playgroud)
预期结果:
key1 col1 col2 col3
0 1 5 11
1 2 4 22
2 3 3 33
Run Code Online (Sandbox Code Playgroud)
小智 6
如果你想让col3保持字符串类型,那么只需在qsql查询中暂时转换?
q)select from bb where ("J"$col3) <= 33
key1 col1 col2 col3
-------------------
0 1 5 "11"
1 2 4 "22"
2 3 3 "33"
Run Code Online (Sandbox Code Playgroud)