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 dbForge Studio, 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 from 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:
To create a new condition, do the following:
To remove a condition, click or navigate to condition and press the DELETE or MINUS SIGN key. To remove a group click its logical operator and choose Remove Group from the appeared menu or navigate to the group and press DELETE or MINUS SIGN key.
You also can copy, cut, and paste conditions and groups with CTRL+C, CTRL+X, and CTRL+V keys.
The following clause is generated according to the sample image:
WHERE
Product.Color = 'silver' AND
ProductCategory.Name >= 'components'
Download dbForge Studio for SQL Server and try it absolutely free for 30 days!