Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

MySQL HEX Function

MySQL HEX function is one of the String Functions, which is to convert the given value to the Hexadecimal number. And the MySQL HEX function returns the string representation of that Hexadecimal number. The basic syntax of the HEX Function is

SELECT HEX(N)

SELECT HEX(String_Value);

MySQL Hexadecimal Function Example

The Hexadecimal Function in MySQL converts the user specified number or String to Hexadecimal Number. Next, it returns the Output in String format. The following query shows you multiple ways to use this HEX function on Numeric values.

SELECT HEX(10);

SELECT HEX(2500);

SELECT HEX(1900), HEX(34567890);
MySQL HEX Function 1

Let me take another example to show the HEX(String) String Function. If we specify the string value as the argument, then this MySQL function converts each byte of a character in a string into a hexadecimal digit.

SELECT HEX('Hi');

SELECT HEX('Tutorial Gateway');

SELECT HEX('MySQL');
MySQL HEX Function 2

Filed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions

Copyright © 2021· All Rights Reserved by Suresh.
About | Contact | Privacy Policy