Skip to main content
Version: 0.0.1

ASCII

Categories: String

ASCII

Returns the ASCII code for the first character of a string. If the string is empty, 0 is returned.

Syntax

ASCII(expression varchar) → int32

  • expression: The string for which the ASCII code for the first character in the string is returned.

Examples

{{< codeheader "ASCII example" >}}

SELECT ASCII ('DREMIO')
-- 68

{{< codeheader "ASCII example" >}}

SELECT ASCII ('D')
-- 68

{{< codeheader "ASCII example" >}}

SELECT ASCII ('')
-- 0