概述
以下範例示範如何將邏輯 AND (&) 和 OR (|) 運算子與 SelectWhere 訊息一起使用來選擇符合多個條件的行。
指示
在 JMP® 會話中,按一下檔案選單並選擇新建 ► 腳本。複製以下腳本並將其貼上到腳本視窗中。若要執行範例腳本,請按一下「編輯」功能表並選擇「執行腳本」 。
/* Open a sample data table */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
/* Select rows where students are over 13, who are also less than 65 inches tall */
dt << Select Where( :age > 13 & :height < 65 );
Wait( 2 ); // For demonstration purposes
dt << Clear Select; // For demonstration purposes
/* Select rows where students are either 12 or 14 years old */
dt << Select Where( :age == 12 | :age == 14 );
附加文檔
有關 JMP 腳本語言的更多信息,請訪問腳本指南 可用在線上幫助.
[以前的 JMP 註 49517]