Skip to main content
Version: 24.3.x

Categories: System

LAST_QUERY_ID

Returns the ID for the most recently executed query in the current session. This function cannot be used in a reflection.

Syntax

LAST_QUERY_ID() → varchar

Examples

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

Usage Notes

This function can be called without the parentheses.