Joe Celko's SQL for Smarties: Advanced SQL Programming, Third Edition

Chapter 10: Valued Predicates

Valued predicates is my term for a set of related unary Boolean predicates that test for the logical value or NULL value of their operands. IS NULL has always been part of SQL, but the logical IS predicate was new to SQL-92, and is not well implemented at this time.

10.1 IS NULL Predicate

The IS NULL predicate is a test for a NULL value in a column with the syntax:

 ::=  IS [NOT] NULL

It is the only way to test to see if an expression is NULL or not, and it has been in SQL-86 and all later versions of the standard. The SQL-92 standard extended it to accept , instead of a single column or scalar expression, as we saw in Section 9.2.

This extended version will start showing up in implementations when other row expressions are allowed. If all the values in row R are the NULL value, then R IS NULL is TRUE; otherwise, it is FALSE. If none of the values in R are NULL value, R IS NOT NULL is TRUE; otherwise, it is FALSE. The case where the row is a mix of NULL and non- NULL values is defined by Table 10.1, where Degree means the number of columns in the row expression.

Table 10.1: Cases Where a Row Is a...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Chip Antennas
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.