Categories: Context

LAST_QUERY_ID

Returns the ID for the most recently executed query in the current session.

Syntax

LAST_QUERY_ID() → varchar

Examples

SELECT LAST_QUERY_ID()
-- 1f1ae232-55c0-9df3-caa9-2c52deecf300
SELECT LAST_QUERY_ID
-- 1f1ae232-55c0-9df3-caa9-2c52deecf300

Usage Notes

This function can be called without the parentheses.