Skip to main content
Version: Latest-4.0

last_query_id

Obtains the ID of the most recently executed query in the current session.

Syntax​

VARCHAR last_query_id();

Parameters​

None

Return value​

Returns a value of the VARCHAR type.

Examples​

mysql> select last_query_id();
+--------------------------------------+
| last_query_id() |
+--------------------------------------+
| 7c1d8d68-bbec-11ec-af65-00163e1e238f |
+--------------------------------------+
1 row in set (0.00 sec)

Keywords​

LAST_QUERY_ID

Rocky the happy otterStarRocks Assistant

AI generated answers are based on docs and other sources. Please test answers in non-production environments.