Previous Topic

Next Topic

Book Contents

Book Index

GUI Query Builder - Where Tab

Access this window from the Where tab of the Query Builder.

This window is used to build the Where Clauses comprising a Where Statement. The Where statement specifies which rows will be returned by the query.

Where Statements

A Where Statement consists of a number Where clauses, connected by ANDs and ORs; and indented within various levels of brackets

For instance, the following Where Statement consists of 4 Where Clauses

(name=’fred’ and state=’CA’) or (salary<10000 and name is null)

When you go the Where tab, you will be shown the individual Where clauses in your query.

query_builder_where

Building a Where Statement

You build your Where statement in two steps:

Understanding AND / OR

People new to SQL can sometimes be confused about the meaning of AND and OR as they can appear to have a different meaning to ordinary speach.

So

Show Clauses as Numbers

When you have a complex Where Statement, it can be difficult to visualize how the clauses connect. In this case it can be useful to select Show Clauses as Numbers. When this is done, the Where statement is shown in the following format - this can be make it easier to interpret.

query_builder_where2

Disabling a Where Clause

You can disable a Where clause by checking the Disable check box.

This "removes" the Where Clause from the query, however it will remain in the grid and can easily be added back in.

Show What

If you are building a Summary Query, you will get another box:

query_builder_where3

This specifies whether the grid is to show your Where Statement or your Having Statement. This is discussed in Having Statement