To extract only the username part : USER : Information Functions MySQL TUTORIALS


MySQL TUTORIALS » Information Functions » USER »

 

To extract only the username part


mysql>
mysql> SELECT SUBSTRING_INDEX(USER(),'@',1);
+-------------------------------+
| SUBSTRING_INDEX(USER(),'@',1|
+-------------------------------+
| root                          |
+-------------------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Information Functions
» USER