HASH

The HASH function returns the partition number of a set of values.

Read syntax diagramSkip visual syntax diagram
            .-,----------.      
            V            |      
>>-HASH--(----expression-+--)----------------------------------><

Also see the PARTITION function. For more information about partition numbers, see the DB2® Multisystem topic collection.

expression
Start of changeAn expression that returns a value of any built-in data type except date, time, timestamp, floating-point, XML, or DataLink values.End of change

The result of the function is a large integer with a value between 0 and 1023.

If any of the arguments are null, the result is zero. The result cannot be null.

Example