January 2019
Beginner
556 pages
14h 19m
English
Row and array comparison constructs are used to make multiple comparisons between values, groups of values, and arrays.
The IN expression is used to check whether a value equals any of the values from a list. The expression is as follows:
a IN (1, 2, 3)
The preceding code will return true if a is equal to 1, 2, or 3. It's a shorter and cleaner way of implementing the logic than using comparison operators, as follows:
(a = 1 OR a = 2 OR a = 3)
SQL allows the use of array types, which are several elements as a whole in one single value. You will learn more about arrays in Chapter 9, Beyond Conventional Data Types. Arrays can be used to enrich comparison conditions. For example, this checks whether a is bigger ...
Read now
Unlock full access