WEIGHT_STRING()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
Returns a binary string representing the string's sorting and comparison value. A string with a lower result means that for sorting purposes the string appears before a string with a higher result.
EXAMPLES
SET @str = CAST('ABC' AS BINARY);
SELECT HEX(WEIGHT_STRING(@str));
+--------------------------+
| HEX(WEIGHT_STRING(@str)) |
+--------------------------+
| 414243 |
+--------------------------+
SET @str = _utf8mb4 'ABC';
SELECT HEX(WEIGHT_STRING(@str));
+--------------------------+
| HEX(WEIGHT_STRING(@str)) |
+--------------------------+
| 004100420043 |
+--------------------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.