4

私は次のように構築されたテーブルを持っています:

tab: ([]col1:();col2:())
`tab insert (`testsym; "testchararr")

col2値を持つ行を選択したいと思います"testchararr"。私は次のように試しました:

select from tab where col2 = "test"

しかし、これは常に'lengthエラーを返します。

char 配列の値に基づいてクエリを実行するにはどうすればよいですか? ありがとう

4

2 に答える 2

5

「好き」または副詞を使用します。例えば

q)select from tab where col2 like "testchararr"
col1    col2
---------------------
testsym "testchararr"

q)select from tab where col2~\:"testchararr"
col1    col2
---------------------
testsym "testchararr"

q)select from tab where col2 like "test"
col1 col2
---------

q)select from tab where col2~\:"test"
col1 col2
---------

各メソッドの速度を確認することをお勧めします。使用中の qsql のその他の例については、 http ://www.timestored.com/b/forums/topic/string-functions-like-search-replace-regex/ を参照してください。

于 2013-07-26T11:00:51.460 に答える
1

これを理解しました:

like代わりに使用する必要があります=

すなわち

select from tab where col2 like "test"
于 2013-07-26T10:58:11.540 に答える