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.

Chapter 2 Creating and Opening Files 31<br />

Importing Data<br />

SELECT ETH, OCT, CCL4 FROM Solubil<br />

Note: JMP does not require you to end SQL statements with a semicolon.<br />

JMP provides a graphical way of constructing simple SELECT statements without typing actual SQL.<br />

To select certain columns from a data source, highlight them in the list of columns (Figure 2.12).<br />

To highlight several rows,<br />

• Shift-click to select a range of column names<br />

• Ctrl-click (Windows and Linux) or Command-click (Macintosh) to select individual column<br />

names.<br />

Note that the SQL statement changes appropriately with your selections.<br />

Sometimes, you are interested in fetching only unique records from the data source. That is, you want<br />

to eliminate duplicate records. To enable this, use the DISTINCT keyword.<br />

SELECT DISTINCT ETH, OCT, CCL4 FROM Solubil<br />

Sorting Results<br />

You can have the results sorted by one or more fields of the database. Specify the variables to sort by<br />

using the ORDER BY command.<br />

SELECT * FROM Solubil ORDER BY LABELS<br />

selects all fields, with the resulting data table sorted by the LABELS variable. If you want to specify<br />

further variables to sort by, add them in a comma-separated list.<br />

SELECT * FROM Solubil ORDER BY LABELS, ETH, OCT<br />

2 Creating and Opening Files<br />

Using the WHERE Statement<br />

With the WHERE statement, you can fetch certain rows of a data table based on conditions. For example,<br />

you might want to select all rows where the column ETH has values greater than 1.<br />

SELECT * FROM Solubil WHERE ETH > 1<br />

The WHERE statement is placed after the FROM statement and can use any of the following logical<br />

operators.<br />

Table 2.2 WHERE Operators<br />

Operator<br />

Meaning<br />

= Equal to<br />

!= or < > Not equal to<br />

> Greater than<br />

< Less Than<br />

>= Greater than or equal to<br />

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

Saved successfully!

Ooh no, something went wrong!