mysql> select product_name from TB_SVC where ip='XXX.XXX.XXX.XXX';
+------------------------------------------+
| product_name |
+------------------------------------------+
| Å×½ºÆ®ÁøÇà ºÎÇÏºÐ»ê ·Îµå¹ß¶õ¼ (1 CORE ) |
+------------------------------------------+
1 row in set (0.00 sec)
1. ¿ÞÂÊ¿¡¼ ¹®ÀÚ¿ ÀÚ¸£±â
left(Ä÷³¸í ¶Ç´Â ¹®ÀÚ¿, ¿ÞÂÊ¿¡¼ Àß¶ó³¾ ¹®ÀÚ¿ÀÇ ±æÀÌ)
mysql> select left(product_name,5) from TB_SVC where ip='XXX.XXX.XXX.XXX';
+----------------------+
| left(product_name,5) |
+----------------------+
| Å×½ºÆ®ÁøÇà |
+----------------------+
1 row in set (0.00 sec)
2. Áß°£¿¡¼ ¹®ÀÚ¿ ÀÚ¸£±â
substring(Ä÷³ ¶Ç´Â ¹®ÀÚ¿, ½ÃÀÛÀ§Ä¡, ±æÀÌ);
mysql> select substring(product_name,19,1) from TB_SVC where ip='XXX.XXX.XXX.XXX';
+------------------------------+
| substring(product_name,19,1) |
+------------------------------+
| 1 |
+------------------------------+
1 row in set (0.00 sec)
¡Ø PHP ¿¡¼ ¹®ÀÚ¿ ÀÚ¸£±â ÇÔ¼ö´Â substr À̸ç, ½ÃÀÛÀ§Ä¡´Â 0¹øºÎÅÍ ½ÃÀÛ, substring´Â 1¹øºÎÅÍ ½ÃÀÛ
3. ¿À¸¥ÂÊ¿¡¼ ¹®ÀÚ¿ ÀÚ¸£±â
right(Ä÷³¸í ¶Ç´Â ¹®ÀÚ¿, ±æÀÌ)
mysql> select right(product_name,9) from TB_SVC where ip='XXX.XXX.XXX.XXX';
+-----------------------+
| right(product_name,9) |
+-----------------------+
| (1 core ) |
+-----------------------+
1 row in set (0.00 sec)