웹이야기

[MySQL] EXPORT_SET() 본문

D/MySQL

[MySQL] EXPORT_SET()

yeon.Biju 2020. 4. 8. 14:45

MySQL 문자열 함수와 연산자

 

EXPORT_SET()

   - 이건 뭔가 싶다.

 

EXPORT_SET(bits, on, off[, sperator[,number_of_bits]])

의 형태

 

Return a string such that for every bit set in the value bits, you get an on string and for every bit not set in the value, you get an off string. Bits in bits are examined from right to left(from low-order to high-order bits). Strings are added to the result from left to right, separated by the separator string(the default being the comma character , ). The number of bits examined is given by number_of_bits, which has a default of 64 if not specified. number_of_bits is silently clipped to 64 if larger than 64. It is treated as an unsinged integer, so a value of -1 is effectively the same as 64. 

 

mysql> SELECT EXPORT_SET (5, 'Y', 'N', ',', 4);
+----------------------------------+
| EXPORT_SET (5, 'Y', 'N', ',', 4) |
+----------------------------------+
| Y,N,Y,N                          |
+----------------------------------+
1 row in set (0.00 sec)

 

mysql> SELECT EXPORT_SET (6, '1', '0', ',', 10);
+-----------------------------------+
| EXPORT_SET (6, '1', '0', ',', 10) |
+-----------------------------------+
| 0,1,1,0,0,0,0,0,0,0               |
+-----------------------------------+
1 row in set (0.00 sec)

 

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

[MySQL] FIND_IN_SET()  (0) 2020.04.10
[MySQL] FIELD()  (0) 2020.04.08
[MySQL] ELT()  (0) 2020.04.08
[MySQL] CONCAT_WS()  (0) 2020.04.08
[MySQL] CONCAT()  (0) 2020.04.08
Comments