
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What MySQL returns if I provide a non-hexadecimal number as an argument to UNHEX() function?
MySQL returns NULL if we provide any non-hexadecimal number as an argument to UNHEX() function. Following example will demonstrate it.
Example
mysql> Select UNHEX('ANK96598'); +-------------------+ | UNHEX('ANK96598') | +-------------------+ | NULL | +-------------------+ 1 row in set (0.00 sec)
As we know that the valid hexadecimal digits are between ‘0…9’, ‘A…F’ or ‘a…f’ hence the above query returns NULL.
- Related Articles
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What happens if we provide NULL as an argument to MySQL CHAR() function?
- What MySQL ASCII() function returns if I will provide NULL to it?
- What MySQL returns if we convert an empty hexadecimal value to a number?
- What MySQL ELT() function returns if we the index number, provided as an argument, is less than 1?
- What MySQL returns on passing an invalid string as an argument to STR_TO_DATE() function?
- What MySQL ELT() function returns if the index number, provided as an argument, is higher than the number of strings?
- What MySQL returns if we include time components along with date component as an argument to DATEDIFF() function?
- What MySQL returns if we include date components along with time component as an argument to TIMEDIFF() function?
- How MySQL SUBSTRING_INDEX() function returns the substring if we provide the negative value of the argument ‘count’?
- What MySQL returns if we use UNIX_TIMESTAMP() function with no argument?
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL COALESCE() function returns if it has a blank, but not NULL, as the first argument?
- How can I use a SELECT statement as an argument of MySQL IF() function?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?

Advertisements