PC SOFT

WINDEV的在线文档

  • Overview
  • How to proceed?
  • Adding a sort item into the current Select query
  • Deleting a sort item from the current Select query
  • Modifying the sort order of an item in the current Select query
  • Tip
  • Notes
  • Defining several sort items
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
To make the result of a query easier to read, the records can be sorted according to one or more items. Sorting the records means classifying them in an ascending order or in descending order.

For example, the customers can be sorted by name, from A to Z.

Note: Only the items displayed in the result of the query can be sorted.

The sort order is defined when creating the query. However, you have the ability to:

  • add or delete a sort item.
  • modify the sort order performed on an item.

How to proceed?

Adding a sort item into the current Select query

To add a sort item into the current Select query:
  1. Select "Query .. Query description". The description window of the query is displayed.Display the description window of the query: on the "查询" pane, in the "编辑" group, click "描述".
  2. In the middle section, select the requested item.
  3. Display the popup menu of the item, select "Sort the item" and select the sort order.
Notes:
  • To add a sort item, you also have the ability to click the "Sort" button found in the right section and to select "Sort on the selected item".
  • The query editor can also be used to perform a sort on a parameter. All you have to do is click the "Sort" button and to select "Sort on a parameter". In this case, you must specify the name of the parameter that will be used for the sort as well as the default sort order. This sort order can be modified at run time if the content of the parameter contains the sort order. For example: "Customer.CustomerName ASC". This parameter must be passed to the query when it is run. See Passing parameters to a query for more details.

Deleting a sort item from the current Select query

To delete a sort item from the current Select query:
  1. Select "Query .. Query description". The description window of the query is displayed.Display the description window of the query: on the "查询" pane, in the "编辑" group, click "描述".
  2. In the middle section, select the requested item.
  3. Display the popup menu of this item (right mouse click).
  4. Select "Sort the item .. Don't sort".

Modifying the sort order of an item in the current Select query

To modify the sort order of an item in the current Select query:
  1. Select "Query .. Query description". The description window of the query is displayed.Display the description window of the query: on the "查询" pane, in the "编辑" group, click "描述".
  2. In the middle section, select the requested item.
  3. Display the popup menu of this item (right mouse click).
  4. Select "Sort the item" and select the new sort direction for the item.

Tip

To add, modify or delete a sort, click the column used to sort the query items and select the operation to perform in the following menu:

Notes

Defining several sort items

When several sort items are defined, the sorts are nested. To find out the sequence of the different items, clickin the middle section. The sort starts from the first item found in the table of sorted items.

For example, in the window below, the result of the query is sorted:

  • on the total amount of orders first,
  • then on the country of customers,
  • then on the city of customers,
  • finally on the name of customers.

The arrows found to the right of the window are used to modify the sequence of the sort items.

Note: The numbers found beside the arrows also allow you to find out the sequence of the different sort items.