SQL View
PS Query will automatically generate SQL based on how you design your query.
When you go to the "View SQL" tab, you can see the SQL code.
You cannot modify the SQL from this page.

Basics of SQL syntax
Oracle/PeopleSoft utilizes a subset of SQL standard functions
Simply, SQL is a set of instructions listing the SELECT on of specific fields, FROM specific tables WHERE certain circumstances exist.
- SELECT: lists fields or column names used in the query
- FROM: lists tables or records used in the query
- WHERE: lists filters to include or exclude data

Back to top
Distinct
When you wish to have a row of data appear only once—even though it may meet the criteria more than once—use the DISTINCT criteria. Distinct removes duplicate rows of output from the results.
Suppose you want a query that does not show every prospect, but you're interested in the last school attended for each career.
Without Distinct |
| With Distinct |
|
Career | Lst School | Career | Lst School |
GRAD |
| GRAD |
|
GRAD | 000000001 | GRAD | 000000001 |
UGRD | 000000001 | MEDS | 000000001 |
UGRD | 000000001 | UGRD |
|
UGRD | 000000001 | UGRD | 000000001 |
UGRD | 000000001 | UGRD | 000010005 |
UGRD | 000000001 | UGRD | 000010008 |
UGRD | 000000001 | UGRD | 000010009 |
UGRD |
|
|
|
GRAD | 000000001 |
|
|
UGRD | 000000001 |
|
|
UGRD | 000010009 |
|
|
UGRD | 000010005 |
|
|
UGRD | 000010008 |
|
|
UGRD | 000010009 |
|
|
| *more* |
|
|
To set a query to "distinct" mode, click the Properties link and check the Distinct checkbox.

Back to top