Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 680 Bytes

File metadata and controls

36 lines (28 loc) · 680 Bytes
description
Returns the ASCII code for the first character of a string. If the string is empty, 0 is returned.

ASCII

Syntax

ASCII(expression varchar) → int32

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

Examples

{% code title="ASCII example" %}

SELECT ASCII ('SPICE')
-- 68

{% endcode %}

{% code title="ASCII example" %}

SELECT ASCII ('D')
-- 68

{% endcode %}

{% code title="ASCII example" %}

SELECT ASCII ('')
-- 0

{% endcode %}