D/MySQL
[MySQL] LEFT()
yeon.Biju
2020. 4. 14. 14:11
MySQL 문자열 함수와 연산자
LEFT()
-
LEFT(str, len)
의 형태
Returns the leftmost len characters from the string str, or NULL if any argument is NULL.
mysql> SELECT LEFT ('foobarbar', 5) ;
+-----------------------+
| LEFT ('foobarbar', 5) |
+-----------------------+
| fooba |
+-----------------------+
1 row in set (0.00 sec)
mysql> SELECT LEFT ('foo', 5) ;
+-----------------+
| LEFT ('foo', 5) |
+-----------------+
| foo |
+-----------------+
1 row in set (0.00 sec)