Use the SQL Select painter to define a SQL statement to retrieve data for the DataWindow object.
- In the New DataWindow wizard, click SQL Select in the Choose Data Source page and click Next.
The Select Tables dialog box opens.
- Select the tables and views to use in the DataWindow object.
- Select the columns to be retrieved from the database.
- Join the tables if you have selected more than one.
See Joining tables in the PowerBuilder Users Guide.
- Select retrieval arguments if appropriate.
See Using retrieval arguments in the PowerBuilder Users Guide.
- Limit the retrieved rows with where, order by, group by, and having criteria, if appropriate.
See Specifying selection, sorting, and grouping criteria in the PowerBuilder Users Guide.
- To eliminate duplicate rows, select .
The distinct keyword is added to the select statement.
- Click OK.
You return to the wizard to complete the definition of the DataWindow object.