웹이야기

[MySQL] ORD() 본문

D/MySQL

[MySQL] ORD()

yeon.Biju 2020. 4. 14. 14:51

MySQL 문자열 함수와 연산지

 

ORD()

   -

 

ORD(str)

의 형태

 

If the leftmost character of the string str is a multibyte character, returns the code for that character, calculated from the numeric values of its constituent bytes using this formula :

(1st bye code)

+ (2nd byte code * 256)

+ (3rd byte code * 256^2)....

 

If the leftmost character is not a multibyte character, ORD() returns the same value as the ASCII() function.

 

mysql> SELECT ORD('한글') ;
+---------------+
| ORD('한글')   |
+---------------+
|      15570332 |
+---------------+
1 row in set (0.00 sec)

 

mysql> SELECT ORD(2) ;
+--------+
| ORD(2) |
+--------+
|     50 |
+--------+
1 row in set (0.00 sec)

 

 

'D > MySQL' 카테고리의 다른 글

[MySQL] QUOTE()  (0) 2020.04.20
[MySQL] POSITION()  (0) 2020.04.20
[MySQL] OCTET_LENGTH()  (0) 2020.04.14
[MySQL] OCT()  (0) 2020.04.14
[MySQL] MID()  (0) 2020.04.14
Comments