开发者

Just the MySQL username please. Not the host

I'm already aware of USER(). How do I just get the username - i.e the stuff before 开发者_C百科@

+------------------+
| USER()           |
+------------------+
| billy@localhost |
+------------------+

I want simple billy. This will be used in a TRIGGER.

Thanks


SELECT SUBSTRING_INDEX(USER(),'@',1);

See: Information Functions: USER()


from help:

SELECT SUBSTRING_INDEX(USER(),'@',1);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜