Subqueries

From RapidSQL
Jump to: navigation, search

Go Up to Using Query Builder

Query Builder lets you build subqueries for SELECT and CREATE VIEW statements in the WHERE or HAVING clause. The table below describes the options available for a subquery in Query Builder:

Operand Location Description

EXISTS

Left operand

Specifies data that exists in a column.

NOT EXISTS

Left operand

Specifies data that does not exist in a column.

ANY

Right operand

Specifies data satisfying the operator parameters.

ALL

Right operand

Specifies data satisfying the operator parameters.

SELECT

Right operand

Specifies data satisfying the operator parameters.

The table below describes the options and functionality on the Where or Having dialog boxes.

Option Description

Operand (Left)

Lets you click the target column for the first part of your clause.

Operator

Lets you select the target operator.

Operand (Right)

Lets you click the target column for the second part of your clause. Query Builder displays the working subquery in the Statement window.

Subquery

Paste or type the SUBQUERY statement.

To use the WHERE and HAVING dialog boxes to create subqueries, do the following:

  1. On the SQL Statement Tree, expand the Where or Having node, and then expand the And node. If there is not a join listed on the And node, double-click And. If there is a join listed, use the shortcut option below.
OR
On the SQL Statement Tree, right-click the Where or Having node, and then click New.

Topics