SET COLLATION
Applies to: Databricks SQL
Databricks Runtime 18.3 and above
Sets the default collation for the session.
The default collation applies to all string operations for which there is no explicit collation or implicit collation. For details on how the default collation interacts with other collations, see Collation precedence.
Syntax
SET COLLATION collation_name
Parameters
-
The name of the collation. Common collations are:
UTF8_BINARYUTF8_LCASEUNICODEUNICODE_CI
For a complete list of supported collations, see Supported collations.
Examples
SQL
> SET COLLATION UNICODE_CI;
-- Use the default (session) collation because c1 has no collation set.
> SELECT * FROM VALUES('hello'), ('Hello') AS T(c1) ORDER BY c1;
hello
Hello