Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » Context-Sensitive Help » Query Editor


Columns tab

Use this tab to restrict the columns that appear in your result set. You can specify columns, column aliases, computed columns, or subqueries. You specify subqueries using the Expression Editor.


Available columns   This box lists all the tables you chose for your query, and the columns in each table.

Selected columns   By default, all columns are selected for your query. To delete a column, select it in the Selected Columns box and click the Left Arrow. To display a column in your result set, select a column or set of columns in the Available Columns box and click the Right Arrow. Use the Up and Down Arrows to reorder the columns in the Selected Columns box.

If you select the same column more than once, an alias is applied. You can edit the alias name.

DISTINCT   Select DISTINCT if you want to eliminate duplicate rows from your result set.


Many statements take significantly longer to execute when DISTINCT is specified, so you should reserve DISTINCT for cases where it is necessary. In addition, DISTINCT treats nulls as duplicates, so when you select DISTINCT, only one null is returned in the results.

Limit rows   You can choose to retrieve only the first row of the result set, or only the number of rows that you specify. No matter what you choose, the maximum number of rows that appear in the Query Editor is 25.

Results   Click Results at the bottom of the window to see the results of your query, or an error message if the query contains errors.

SQL   Click SQL at the bottom of the window to see the SQL code for your query.

Adding a subquery

To add a subquery in the Query Editor, click the Add a Computed Column button, which is located between the lists of columns. The Expression Editor appears. In the Expression Editor, click the Subquery button, which is located beside the Not button.

See also