Advertisement

Latest Post

Sunday, 18 September 2016

How to use ASCII Sql function

ASCII stands for American Standard Code for Information Interchange.
ASCII code is the numerical representation of a character

Its Returns the numeric value of the first character of string.
Its Returns 0 if we pass the empty string.
Its Returns NULL if string is NULL.
ASCII() returns numeric values from 0 to 255.

Syntax:
ASCII(string_expression)

Example:

SELECT ASCII('Hello');

above query will give first character ASCII code that is 72

SELECT ASCII('A');
above query give ASCII code 65

SELECT ASCII('');
its Returns NULL

SELECT ASCII(NULL);

its Returns NULL

Government Jobs