The Query() JSL function performs a SQL query on selected tables and exports the data to a data table. The following example first assigns the t1 alias to Big Class.jmp. name, age greater than 13, and height are then selected from the t1 table.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Open( Table( dt, "t1" ),
       "SELECT t1.name, t1.age, t1.height FROM t1
       WHERE t1.age > 13;"
You can use SQL functions in a query. For example, SELECT CURRENT_TIMESTAMP returns the current UTC/GMT time stamp as a SQLite time string:
Query( Scalar, "SELECT CURRENT_TIMESTAMP;" );
Contents