Including Fields in GROUP BY or ORDER BY Clauses
When you need to group resulting data, you must specify the field you want to group on in GROUP BY clause. When you want to sort data by a field, you must include the field in the ORDER BY list. In dbForge Studio, the interface for this clauses is approximately the same. The only difference is that the ORDER BY tab has the Change Order button that you can use to alter sorting direction.
Including Fields in ORDER BY Clause
To include fields in ORDER BY clause, switch to the corresponding tab of the tabbed editor and perform the following steps:
- Select the field you want to perform grouping/ordering on and click the right arrow button.
- Repeat this operation for every field that should be added to the clause.
- Use the up arrow and down arrow buttons to change the order of columns.
- If you want to exclude a field from the list, select it and click the left arrow button.
- For ordering lists, select a field and click the Change Order button to alter the sorting order.