This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

ASCII

Syntassi

ASCII(str)

Spiegazione

Restituisce il valore numerico del carattere più a sinistra della stringa str. Restituisce 0 se str è vuota. Restituisce NULL se str è NULL. ASCII() funziona solo con i caratteri di 8 bit.

Esempi

MariaDB [(none)]> SELECT ASCII('2');
+------------+
| ASCII('2') |
+------------+
|         50 |
+------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT ASCII(2);
+----------+
| ASCII(2) |
+----------+
|       50 |
+----------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT ASCII('dx');
+-------------+
| ASCII('dx') |
+-------------+
|         100 |
+-------------+
1 row in set (0.00 sec)
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.