|
|
|
|
|

α Խù

Խù 58
   
[MYSQL] substring_index (й ڸ)
۾ : ְ ¥ : 2014-10-02 () 13:48 ȸ : 7553
ּ :
                          

йڸ ڸ
ex1)  . йڸ 3 ڸ
mysql> select substring_index('192.168.1.111','.',3);
+----------------------------------------+
| substring_index('192.168.1.111','.',3) |
+----------------------------------------+
| 192.168.1                              |
+----------------------------------------+
1 row in set (0.01 sec)

ex2) 
select substring_index(nic_ip,'.',3) as ip_class from TB_TEST where isused='0' group by ip_class order by INET_ATON(nic_ip);
+------------+
| ip_class   |
+------------+
| 192.168.20  |
| 192.168.21  |
| 192.168.22  |
| 192.168.23  |
| 192.168.24  |
| 192.168.25  |
| 192.168.27  |
| 192.168.29  |
| 192.168.30  |
| 192.168.74  |
| 192.168.108 |
| 192.168.141 |
| 192.168.181 |
| 192.168.182 |
+------------+
14 rows in set (0.05 sec)


̸ н
б (üũϸ ۾̸ Ȯ ֽϴ.)
ڸ Էϼ.
   

 



 
Ʈ : | ǥ : ̰ | Ŀ´Ƽ : Ű ü(OS) | ⵵ д籸 | ڿ : mojilychonnom.com Copyright www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.