Building WHERE or HAVING Clause

When retrieving data, you may want to set up a filtering expression or relation between tables. You can do it using WHERE and HAVING clauses. Refer to SQL manual to learn what’s different in these sections. In Fusion for SQL Server visual interface for WHERE and HAVING clauses is the same.

In the tabbed editor, conditions are displayed as a tree with condition and group nodes. A group consists of several conditions or subgroups, united with a logical operator. You can change a group logical operator by clicking it and selecting another one on the menu. To navigate between conditions and groups, use the UP ARROW and DOWN ARROW keys. Use the LEFT ARROW and RIGHT ARROW keys to navigate between criteria operator and operands.

To create a new group, do one of the following:

  • Click the upper-level group operator and choose Add Group on the menu that appears.

  • Press CTRL+PLUS SIGN.

Building WHERE and HAVING Clause

To create a new condition, perform the following steps:

  1. Navigate to the group you want to enhance and click the button or press INSERT or the PLUS SIGN key. Alternatively, click the upper-level group operator and choose Add Condition on the menu that appears.

  2. Click the condition column and select the column you need on the menu that appears.

  3. Click the condition criteria operator and select the criteria operator you want from the list.

  4. If the condition operator requires operand value(s), specify it (them).

To remove a condition, click the Condition button or navigate to the condition and press DELETE or the MINUS SIGN key. To remove a group, click its logical operator and choose Remove Group on the menu that appears or navigate to the group and press DELETE or the MINUS SIGN key.

You also can copy, cut, and paste conditions and groups with CTRL+C, CTRL+X, and CTRL+V keys.

Where tab

The following clause is generated according to the sample image:

WHERE
  Product.Color = 'silver' AND
  ProductCategory.Name >= 'components'