Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A HAVING clause helps you set conditions that filter which group results appear in the final results of your query. When a column is dropped inside the [Having Deck] the [Create Having Criteria] Dialog appears.

Query Builder - Drag Column to HavingImage RemovedImage Added

This dialog allows:

...

As more columns are dragged into the Having Deck they are numbered in sequence and the bottom of the deck indicates the Filter Logic by referring to the numbers instead of the full column names to conserve space.

Query Builder - Multiple Having CriteriaImage RemovedImage Added

The SQL Pane will use the full column names in its HAVING Clause.

...

The Query Builder attempts to automatically set appropriate logic based on the columns dropped in the Having Deck and will prompt you if the Filter Logic you manually generate is not valid. If a column used in the Filter Logic has been dropped from the database, that column will highlight in red to notify you that action should be taken. See the Invalid Objects, Filter Logic, or Joins page for more.

To modify a HAVING Clause:

1. Either right-click on a column listed in the Having Clause Deck and select [Edit...]

2. Or left-click on the menu triangle to the right of the column listed in the Having Clause Deck and select [Edit...]

Query Builder Having DialogImage RemovedImage Added

Remove a HAVING Clause

...

It's also possible to remove each column from the HAVING Clause by

1. Right-clicking it and selecting [Remove]

or

2. Left-clicking its menu triangle and selecting [Remove]

or

3. Left-clicking a column to select it, then press [Delete]

...

When multiple criteria appear in the Where and Having Decks it's possible to modify their Criteria their Criteria Filter Logic. Three choices appear if you right-click on existing Filter Logic:

  • AND ALL - The default which uses uses all of the criteria with AND between each.
  • OR ALL - Uses OR between each criteriacriterion.
  • Custom - For creating your own Criteria Filter Logic.

Query Builder - Modifying Having Criteria Filter LogicImage RemovedImage Added

To use Custom Filter Logic:

1. Right-click on the Filter Logic and choose [Custom].

2. Within the [Edit Filter Logic] Dialog enter your Custom Criteria Filter Logic.

Query Builder - Custom Having Criteria Filter LogicImage RemovedImage Added

3. Click [Save] in the [Custom Filter Logic] Dialog and the SQL Pane updates updated to show it's there. A cog icon next to the Filter Logic indicates a Custom Criteria Filter Logic is in use.

Info

Criteria Filter Logic will highlight with an orange background when you haven't used all of the existing criteria. Hovering over an orange Filter Logic produces a tooltip with suggestions for what could be altered.

Query Builder - Having - OrangeImage RemovedImage Added

Query Builder - Having - Orange - TooltipImage RemovedImage Added