select cust_id, cust_name, UPPER( CONCAT( LEFT(cust_name,2), LEFT(cust_city,3) )) as user_login from Customers; UPPER()将字符串转大写,CONCAT(STR1,STR2)用于拼接两个字符串,LEFT(STR1,NUM)从STR1左边数NUM个字符作为子字符串,类似于Python中的STR1[:0+NUM+1]还有一个相反的函数叫做RIGHT(STR1,NUM),这个就从右往左开始数NUM个字符作为子字符串,类似Python中的STR1[-1-NUM+1:-1]