Feedback

  • Contents
 

Create a SQL Statement

Use the SQL Author window to create a custom SQL statement based on specified criteria.

To create a SQL statement

  1. In the Main Menu window, from the Tools menu, click SQL Author. The SQL Author window appears.

SQL Author window

  1. To exclude duplicate records from the query results, select Exclude Duplicate Records.

  2. To limit the query results to a specific number of records, select Maximum Records and then, in the box, type the maximum number of records to include in the results.

  3. In the Select Columns pane, do the following as necessary:

  1.  In the Conditions pane, do the following as necessary:

  1. In the Order pane, do the steps to Specify the Sort Order for Query Results.

Note: As you create the query, the SQL statement appears in the SQL statement panel.

  1. To count the number of records that match the selection criteria, in the toolbar, click Count. The results appear in the Query Designer dialog box. Click OK.

  2. To save the query, do the following:

    1. In the toolbar, click Save. The Save Query Dialog box appears.

Save Query Dialog box

    1. In the Query Name box, type a name for the query and then click Save.

Tip: To overwrite an existing query, in the Name column, click the query to overwrite and then click Save.

You can run the saved query using another query tool or copy and paste the SQL statement into another program.

  1. To copy the SQL statement so you can paste it into another program, do the following:

    1. In the SQL statement panel, use your mouse to select all the content in the pane.

    2. Right-click on the selected content and click Copy. The system copies the statement to the Clipboard. You can now paste it into another program.

Related Topics

SQL Author