UUID()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a unique value of Universal Unique Identifier.
USAGE
UUID()
DETAILS
UUID()
is an information function that returns a Universal Unique Identifier (UUID).
The return value is an ASCII string that is globally unique. Every call returns a new unique value, even within a single statement.
The return value conforms to RFC 4122, "A Universally Unique Identifier (UUID) URN Namespace". It encodes 128 bits of unique information.
EXAMPLES
Simple Example
SELECT UUID();
+--------------------------------------+
| UUID() |
+--------------------------------------+
| f09d9263-ee58-11eb-8805-badd8ed179a2 |
+--------------------------------------+
SELECT UUID();
+--------------------------------------+
| UUID() |
+--------------------------------------+
| f1858aad-ee58-11eb-8805-badd8ed179a2 |
+--------------------------------------+
SELECT IF(UUID() = UUID(), 'DUPLICATED!', 'different') AS two_calls;
+-----------+
| two_calls |
+-----------+
| different |
+-----------+