unicode()

Returns an INTEGER representing the unicode codepoint of the first character in the string.

Reference: DuckDB 2.0.0

Arguments & returns

unicode(string)

Scalar
Overload link string Returns
#01 VARCHAR INTEGER

Example

unicode example
SQL
Haybarn WASM 2.0.0-rc12 · In your browser

Engine example · Run to view results.

In other engines

Used in larger rewrites 1

These examples use unicode as one part of a larger SQL translation.

Snowflakeunicode()

UNICODE(foo)
In DuckDB
CASE WHEN foo = '' THEN 0 ELSE UNICODE(foo) END

SQLGlot example ↗