LEFT(str,len)
The LEFT mysql function returns the leftmost len characters from the string str or returns NULL if any argument is NULL.
The LEFT function is multibyte safe.
Here are some example which will explain you this function-
mysql> SELECT LEFT('HELLO MYSQL WORLD',5);
+-----------------------------+
| LEFT('HELLO MYSQL WORLD',5) |
+-----------------------------+
| HELLO |
+-----------------------------+
1 row in set (0.00 sec)
mysql> SELECT LEFT('HELLO MYSQL WORLD',-1);
+------------------------------+
| LEFT('HELLO MYSQL WORLD',-1) |
+------------------------------+
| |
+------------------------------+
1 row in set (0.00 sec)
mysql> SELECT LEFT('HELLO MYSQL WORLD',10);
+------------------------------+
| LEFT('HELLO MYSQL WORLD',10) |
+------------------------------+
| HELLO MYSQ |
+------------------------------+
1 row in set (0.00 sec)
0 Comment(s)