+
+
+
+
+
+
+
+
To check whether a value is or is not null, use the constructs
expression IS NULL
behavior conforms to the SQL standard.
+
Some applications may expect that
expression = NULL
the default behavior in
PostgreSQL
releases 6.5 through 7.1.
+
+
+
+
+ The ordinary comparison operators yield null (signifying unknown>)
+ when either input is null. Another way to do comparisons is with the
+ IS DISTINCT FROM construct:
+
+expression IS DISTINCT FROM expression
+
+ For non-null inputs this is the same as the <>> operator.
+ However, when both inputs are null it will return false, and when just
+ one input is null it will return true. Thus it effectively acts as though
+ null were a normal data value, rather than unknown>.
+
+
+
+
+
+
+
+
+
+
+
+
+
Boolean values can also be tested using the constructs
expression IS TRUE
expression IS UNKNOWN
expression IS NOT UNKNOWN
- These are similar to IS NULL in that they will
- always return true or false, never a null value, even when the operand is null.
+ These will always return true or false, never a null value, even when the
+ operand is null.
A null input is treated as the logical value unknown>.
+ Notice that IS UNKNOWN> and IS NOT UNKNOWN> are
+ effectively the same as IS NULL and
+ IS NOT NULL, respectively, except that the input
+ expression must be of Boolean type.
-
NOT IN
+
NOT IN
expression NOT IN (subquery)
Row-wise Comparison
-
+ zone="functions-subquery">
- of rows
+ subquery result row
+
+ row-wise
+
+
+
+
+
+
+
+
+
+
+
This section describes several specialized constructs for making
multiple comparisons between groups of values. These forms are
constructor
+
+
+
An array constructor is an expression that builds an
array value from values for its member elements. A simple array
constructor
+
+
+
A row constructor is an expression that builds a row value (also
called a composite value) from values
for its member fields. A row constructor consists of the key word
- ROW, a left parenthesis (>, zero or more
+ ROW, a left parenthesis, zero or more
expressions (separated by commas) for the row field values, and finally
- a right parenthesis )>. For example,
+ a right parenthesis. For example,
SELECT ROW(1,2.5,'this is a test');