MySQL Programming Question:

Download Job Interview Questions and Answers PDF

How To Enter Numeric Values as HEX Numbers?

MySQL Programming Interview Question
MySQL Programming Interview Question

Answer:

If you want to enter numeric values as HEX numbers, you can quote HEX numbers with single quotes and a prefix of (X), or just prefix HEX numbers with (0x). A HEX number string will be automatically converted into a numeric value, if the expression context is a numeric value. Here are some good examples:

SELECT X'10' + 16 FROM DUAL;
32

SELECT 0x1000 + 0 FROM DUAL;
4096

Download MySQL Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How To Enter Characters as HEX Numbers?How To Enter Binary Numbers in SQL Statements?