The WHERE clause is used to set up a filtering condition on the selected columns to extract only those records that fulfill a specified condition.
dbForge Query Builder for SQL Server allows you to create the WHERE clause in the SELECT, INSERT INTO, and UPDATE statements.
To work with WHERE clauses, open the Tabbed Editor by clicking Show Tabbed Editor on the Query toolbar or Query menu.
The Tabbed Editor displays the WHERE clause as a tree with the condition and condition groups. A group consists of several conditions or subgroups, combined with a logical operator.
You can use arrow keys for navigation:
The guide covers how to:
1. On the WHERE tab, use one of the following ways to add a new condition:
2. In a new WHERE syntax construction that opens, do the following:
3. When switching to the Text view, you can preview the SELECT statement with the specified WHERE clause.
You can create, modify, or remove groups and conditions in the WHERE clause.
To create a new group
1. On the Where tab, open the group construction by using one of the following ways:
2. Click enter a value to set the conditions to be provided in the WHERE clause.
3. Click the condition criteria operator and select the criteria operator you want from the list.
4. If the condition operator requires operand values, specify them.
5. Switch to the Text view to check the result.
To remove a condition, click or navigate to condition and press the DELETE or MINUS SIGN key.
To remove a group, do one of the following:
To remove all conditions and groups, click the upper-level operator and select CLear All.
You also can copy, cut, and paste conditions and groups with CTRL+C, CTRL+X, and CTRL+V keys.