14.03.2014 Views

Download Jmp User Guide

Download Jmp User Guide

Download Jmp User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

30 Creating and Opening Files Chapter 2<br />

Importing Data<br />

Figure 2.12 Reading All Variables From the Big Class Table Stored in an Excel File<br />

List of tables that are<br />

accessible in the<br />

current database<br />

List of columns that appear in the<br />

table. Highlight another table name in<br />

the list on left to view its columns<br />

Type the SQL<br />

statement in this box<br />

4 Click Execute SQL. The SQL statement becomes an SQL table variable in the JMP data table. (See<br />

“Adding Table Variables,” p. 84, for details.)<br />

For example, if you want to import only the name and age of females older than 14, then the SQL<br />

shown in Figure 2.12 would be different. Instead of this statement:<br />

SELECT * FROM Bigclass<br />

you would write:<br />

SELECT NAME, AGE FROM Bigclass where AGE>14 and SEX=‘F’<br />

After you click Execute SQL, a JMP data table appears with columns Name and Age.<br />

Note that you can enter any valid SQL statement and click Execute SQL to execute the command.<br />

Valid SQL varies with the data source and ODBC driver.<br />

Structured Query Language (SQL): A Reference<br />

The following sections are a brief introduction to SQL. They give you insight to the power of queries,<br />

and they are not meant to be a comprehensive reference.<br />

Using the SELECT Statement<br />

The fundamental SQL statement in JMP is the SELECT statement. It tells the database which rows to<br />

fetch from the data source. When you completed the process described in “Opening Data from a<br />

Database,” p. 26, you were actually sending the following SQL statement to your data source.<br />

SELECT * FROM Solubil<br />

The * operator is an abbreviation for “all columns.” So, this statement sends a request to the database to<br />

return all columns from the specified data table.<br />

Rather than returning all rows, you can replace the * with specific column names from the data table.<br />

In the case of the Solubility data table example, you could select the ETH, OCT, and CCL4 columns<br />

only by submitting this statement:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!