JSL クエリ テーブル: 奇妙な結果<BR />dirLoc=Pick Directory("Select a directory", "my directory");
fileList = Files In Directory(dirLoc);
dt1 = open(dirLoc || fileList[1]);
dt1 << Select Where( :Amount>=1000 );
x=dt1<<SUBSET></SUBSET>Greetings!
I am trying a simple query with a sample data file. The query returns right set of results if there is any record satisfying the condition in "Where" clause. But, in case, there exist no record satisfying the condition, it returns all the records where expected result is an empty set. Even, when I try to see how many records (N Row()) in the resultant set, it shows the count of total records.<BR /><BR />Thanks for any suggestion and please let me know if I am missing anything.
<LINGO-LABS id="lingo-labs-722288" slang="en-US" mode="CREATE"><LINGO-LABEL>データアクセス</LINGO-LABEL></LINGO-LABS>Re: JSL クエリ テーブル: 奇妙な結果こんにちは、ジムさん
早速お返事をいただきありがとうございます。実際、複数のテーブルからのクエリの結果を連結しようとしています。あなたの提案を試してみましょう。それについて何かご意見があれば共有してください。
再度、感謝します!
Re: JSL クエリ テーブル: 奇妙な結果これを処理するには、行が選択されているかどうかを確認し、選択されている場合はサブセットを実行し、選択されていない場合はメッセージを出力します。
dirLoc = Pick Directory( "Select a directory", "my directory" );
fileList = Files In Directory( dirLoc );
dt1 = Open( dirLoc || fileList[1] );
dt1 << Select Where( :Amount >= 1000 );
If( Length( dt1 << get selected rows ) > 0,
x = dt1 << Subset( Output Table Name( "T1" ) );
Close( dt1, NoSave );
Show( N Row( x ) );
x << Save( "my directory\t1.jmp" );
,
Show( "no rows selected" )
);