SQL conditions

Previous Next

SQL conditions are used:

In WHERE and HAVING clauses in queries and subqueries *.

In ON clauses in join constructs.

* In WHERE and HAVING clauses, a SQL condition either follows the WHERE keyword, or it follows an AND or OR keyword used to connect multiple conditions.

 

Syntax

USoft supports all industry-standard SQL condition constructs:

condition  ::=  {  column-expression  comparison-operator  column-expression |

                   column-expression  { IS NULL | IS NOT NULL }

                }                   

 

comparison-operator  ::=  

{                         boolean-operator  |

                          { LIKE | NOT LIKE } like-expression |

                          { EXISTS | NOT EXISTS | IN | NOT IN } ( subquery )

}

 

boolean-operator     ::=  {      { = | > | < | >= | <= | <> | != } |

                            not( { = | > | < | >= | <= | <> | != } )

                          }

These syntax options are an integral part of the standard SQL language. There are no USoft extensions in this area. Detailed discussion of SQL conditions is outside the scope of these help topics.

The RELATE keyword is a USoft-specific extension that stands in for a SQL join condition. See join constructs for details.

 

See also

Queries and subqueries

Join constructs

DML statements

Table aliases

Column expressions

Host variables in SQL

Function calls