SQL Query Assistant

 

SQL Query Assistant makes it easy to create and run simple SQL Queries. Use a graphical interface to select result fields, sort order, selection criteria and run your query.

 

 

Start the SQL Query Assistant

To start the SQL Query Assistant double-click a table name either in the Database Navigator or in Database Quick Access. The assistant's main window is displayed.

The SQL Query Assistant offers three main options:


Display full table   This is the default option. Press RETURN or click on finish to display all records from the selected table with SQL Viewer. You can modify the query manually in SQL Viewer.
     
Use Query Assistant   Select this option and click "Next >>" to use the actual query assistant and generate your SQL Query.
     
Modify SQL Query   Select this option and click "Next >>" to see the SQL command which retrieves the full table. Modify the command and click "Finish" to run the SQL command with SQL Viewer.

Select "Use Query Assistant" and click "Next >>" to continue with the assistant.

     
 

Choose result set fields for your query

The list on the left side shows all columns (fields) available in your selected table. Select the fields you want to list in your result set on the left side and click ">" to copy them to the right side. All fields listed on the right side will be part of your result set.

If you want to remove a column name from the right list, select the column name and click "<". With ">>" all available fields are added to your result at once and "<<" removes all fields from your result.

Click "Next >>" to continue with the assistant.

     
 

Specify conditions

If you do not want to include all records in the result set you can specify up to two conditions. Only records matching either one of the conditions (if your select "OR") or both conditions (if you select "AND") are displayed. If you want to include all records in your result set do not enter a value on this page.

Click "Next >>" to continue with the assistant.

     
 

Sort your result set

To sort your result set add the column names from the left side to the right side. You can specify more than one sort column. The top most column on the right side is the primary sort criteria. If more than one record have the same value in this column the next value on the right side is used for sorting and so on.

You can choose to sort by the added column either ascending (asc) or descending (desc).

If you do not need any sorting of the results leave the right list empty. The records will be displayed in storage order, this is the internal order of your database server.

Click "Next >>" to continue with the assistant.

     
 

Modify SQL Query

The SQL Query is generated based on your selection. You can now make manual adjustments if you want to.

Click "Finish" to run the SQL command and display the result set with SQL Viewer. The SQL Query Assistant is closed and a new SQL Viewer window is opened.

     
 

Display result set with SQL Viewer

SQL Viewer displays the result set. You can modify your query manually, save the query as double-clickable file or export the result set.

For more information on SQL Viewer see section "Run SQL Queries".