PC SOFT

WINDEV的在线文档

  • Overview
  • How do I add a selection condition?
  • Adding a selection condition into a Select query
  • Adding a selection condition into an Update query or into a Delete query
  • How do I modify a selection condition?
  • Modifying a selection condition in a Select query
  • Modifying a selection condition in an Update query or in a Delete query
  • How do I delete a selection condition?
  • Deleting a selection condition from a Select query
  • Deleting a selection condition from an Update query or from a Delete query
  • Tip
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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
The selection conditions of the records are applied to the items used in the queries. These conditions are used to select the records that correspond to one or more specific criteria.

For example:

  • customers whose name starts with "C".
  • items whose price exceeds 500 Euros.
  • orders placed between "01/01/2000" and "06/01/2000".
  • ...
Several selection conditions can be defined for a single item.

The selection conditions are defined when creating the query. However, you have the ability to add, modify or delete the selection conditions used in a query. These operations are described in the following paragraphs.

When at least two selection conditions are found in a query, the sequence of the selection conditions must be specified. See Sequence of selection conditions for more details.

How do I add a selection condition?

Adding a selection condition into a Select query

To add a selection condition into a Select query:
  1. Select "Query .. Query description". The description window of the query is displayed.On the "查询" pane, in the "编辑" group, click "描述". The description window of the query is displayed.
  2. In the middle section, select the item onto which the selection condition must be added.
  3. Click the "Selection condition" button and select "New condition". The wizard for creating a selection condition is displayed.
  4. Choose the selection criteria (equal to, greater than, ...) of the condition. This condition can be applied to a given value, a parameter, the records selected by another query, ... For a date item, the selection condition can be applied to a preset date (the current year, the current month, today).
    Note: You have the ability to select a given value via. The following menu is displayed:
    You can:
    • select one of the possible values among the values found in the file
    • view the entire file.
      Caution: This option is available only if the Live Data is enabled. See Live Data for more details.
  5. Indicate (if necessary) a comment on the condition. This comment will be displayed in the SQL code of the query (preceded by the "--" or "//" character). If the condition is applied to a parameter, when running a GO test of the query with parameters, the comment will be displayed in the window for entering the parameters.
  6. Validate. The selection condition is automatically added to the query.

Adding a selection condition into an Update query or into a Delete query

To add a selection condition into an Update query or into a Delete query:
  1. Select "Query .. Query description". The description window of the query is displayed.On the "查询" pane, in the "编辑" group, click "描述". The description window of the query is displayed.
  2. Display the "Query" tab.
  3. Select the item onto which a selection condition must be added and click the "Condition" column corresponding to the selected item. The wizard for creating a selection condition is displayed.
  4. Select "I want to add a condition" (for an item onto which at least one condition is performed).
  5. Choose the selection criteria (equal to, greater than, ...) of the condition. This condition can be applied to a given value, a parameter, a sub-query, ...
  6. Indicate (if necessary) a comment on the condition. This comment will be displayed in the SQL code of the query (preceded by the "--" or "//" character). If the condition is applied to a parameter, when running a GO test of the query with parameters, the comment will be displayed in the window for entering the parameters.
  7. Validate. The selection condition is automatically added to the query.

How do I modify a selection condition?

Modifying a selection condition in a Select query

To modify a selection condition in a Select query:
  1. Select "Query .. Query description". The description window of the query is displayed.On the "查询" pane, in the "编辑" group, click "描述". The description window of the query is displayed.
  2. In the middle section, select the item on which a condition must be modified.
  3. Click the "Selection condition" button and select "Modify the condition".
  4. Select (if necessary) the selection condition to modify (for an item on which several conditions are performed.
  5. Modify the selection condition.
  6. Validate. The selection condition is automatically modified.

Modifying a selection condition in an Update query or in a Delete query

To modify a selection condition in an Update query or in a Delete query:
  1. Select "Query .. Query description". The description window of the query is displayed.On the "查询" pane, in the "编辑" group, click "描述". The description window of the query is displayed.
  2. Display the "Query" tab.
  3. Select the item on which a condition must be modified and click the corresponding "Condition" column. The wizard for selection conditions is displayed.
  4. Select "Modify an existing condition".
  5. Select (if necessary) the selection condition to modify (for an item on which several conditions are performed.
  6. Modify the selection condition.
  7. Validate. The selection condition is automatically modified.

How do I delete a selection condition?

Deleting a selection condition from a Select query

To delete a selection condition from a Select query:
  1. Select "Query .. Query description". The description window of the query is displayed.On the "查询" pane, in the "编辑" group, click "描述". The description window of the query is displayed.
  2. In the middle section, select the item from which a condition must be deleted.
  3. Click the "Selection condition" button and select "Delete a condition".
  4. Select (if necessary) the selection condition to delete (for an item on which several conditions are performed.
  5. Validate. The selection condition is automatically deleted from the query.

Deleting a selection condition from an Update query or from a Delete query

To delete a selection condition from an Update query or from a Delete query:
  1. Select "Query .. Query description". The description window of the query is displayed.On the "查询" pane, in the "编辑" group, click "描述". The description window of the query is displayed.
  2. Display the "Query" tab.
  3. Select the item for which a condition must be deleted and click the corresponding "Condition" column. The wizard for selection conditions is displayed.
  4. Select "Delete an existing condition".
  5. Select (if necessary) the selection condition to delete (for an item on which several conditions are performed.
  6. Validate. The selection condition is automatically deleted from the query.

Tip
To add, modify or delete a selection condition in a Select query, click the condition column of the query items and select the operation to perform in the following menu: