You can save more than one query and then select from
a list of queries that you have saved in the current Query Window
session or in a previous Query Window session. In this example, you
create and save several queries for later selection from a list of
the saved queries.
From the
SQL QUERY COLUMNS window, select
ViewTables to return to the
SQL QUERY TABLES window.
Remove SAMPLE.WAGE from
the Selected Tables list. Select
OK to display
the
SQL QUERY COLUMNS window.
Select
Salary from the Available Columns list and add it to the Selected Columns
list. Select
ViewWhere Conditions for Subset to display
the
WHERE EXPRESSION window.
Select
Salary from the Available Columns list. Select
GT (greater than) from the list of operators. Select
<LOOKUP
distinct values> from the Available Columns list.
Select
$25,000 from the
Lookup
Values window. Select
OK to
save your WHERE expression.
Select
ViewOrder By to display the
ORDER BY COLUMNS window. Select
Salary from the Available
Columns list and add it to the Selected Columns list. Select
OK to return to the
SQL QUERY COLUMNS window.
In addition to the method
of saving queries that was described earlier, you can also select
FileSave QuerySave as Query to Include later. Type
ABOVE25
in the
Entry Name field.
Type
Salaries above $25,000
in the description
field. Select
OK.
You can also save queries
that will be processed against different tables. To create the next
query that you will save, select
ViewTables to return to the
SQL QUERY TABLES window. Remove
SAMPLE.SALARY from the Selected Tables list. If a dialog box appears, then select
OK to clear the WHERE expression.
Select
SAMPLE.EMPINFO from the Available Tables list and add it to the Selected Tables
list. Select
OK to display the
SQL QUERY COLUMNS window.
Add
NAME,
DIVISION, and
Education Level to the Selected Columns list. Select
ViewWhere Conditions for Subset.
Select
Education
level from the Available Columns list. Select
GE (greater than or equal to) from the list of operators.
Select
<LOOKUP distinct values>, and
select
20 from the Lookup Values list. Select
OK to return to the
SQL QUERY COLUMNS window.
Select
FileSave QuerySave as Query to Include later.
Type
EDU20
in the
Entry Name field. Type
Education level above 20 years
in the description field.
Select
OK to save the query.