SQL Anywhere Studio Help
Query Editor Help
Use this tab to sort the rows in your result set.
Available columns This box lists all the tables you have chosen for your query, and the columns in each table. It also lists any computed columns that you defined in the Columns tab.
Order by columns This box stores the columns you have chosen to sort on. To sort on a column, select a column or set of columns in the Available Columns box and click the right arrow. To delete a column, select it in the Order By Columns box and click the left arrow. Use the up and down arrows to specify the order of column evaluation. You can sort on column aliases.
Expression editor Click the Calculator icon, located between the right and left arrows, to open the Expression Editor and build your Order By condition.
Results Click Results at the bottom of the dialog to see the results of your query, or an error message if the query contains errors.
SQL Click SQL at the bottom of the dialog to see the SQL code for your query.
Each item in the ORDER BY list can be labeled as an up arrow for ascending order (the default) or a down arrow for descending order. To change the order from ascending to descending, double-click the arrow; or select the arrow and press F2.
The only way to ensure that rows are returned in a particular order is to use ORDER BY. In the absence of an ORDER BY clause, Adaptive Server Anywhere returns rows in whatever order is most efficient. This means that the appearance of result sets may vary depending on when you last accessed the row and other factors.
For more information about the Query Editor, see Introducing the Query Editor.
For an introduction to ORDER BY, see Ordering query results.
For more information about ORDER BY, see The ORDER BY clause: sorting query results and Sorting query results.