SeqNum

Summary

The SeqNum function returns an increasing value each time it is called.

Syntax

SeqNum([start expression])

Return Type

Long

Details

The returned value starts at 1 for each query. A new query that uses this number restarts at 1 unless a start expression is provided.

It is not guaranteed that the number returned is monotonically increasing. The function only guarantees that the number will be bigger than the previous number returned.

Also, the returned value is not a global value. See NextNum for a function that returns a number larger than the last time the function was called within the JVM.

Examples

SELECT SeqNum() from AllTypes();

Related Functions