题解 | #顾客登录名#

顾客登录名

https://www.nowcoder.com/practice/7cbf5e3082954c21a80fc750ce97350f

select cust_id, cust_name,
#  concat 拼接字符串
#  ucase/upper 转大写 lcase/lower 转小写
#  left(s,n) 返回字符串 s 的前 n 个字符
concat(ucase(left(cust_name,2)),ucase(left(cust_city,3))) as user_login
#  mid(s,n,length) 从字符串 s 的 n 位置截取长度为 length 的子字符串,用法同 substring
# concat(ucase(mid(cust_contact,1,2)),ucase(mid(cust_city,1,3))) as user_login
from Customers

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务