题解 | #顾客登录名#

顾客登录名

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

select cust_id,cust_name,
#upper(concat(substr(cust_name,1,2),substr(cust_city,1,3))) as user_login
upper(concat(left(cust_name,2),left(cust_city,3))) as user_login
from Customers

1.MySQL的substr和substring是一样的。都是提取字符串的子字符串https://blog.csdn.net/lanxingbudui/article/details/83782276

2.upper大写,lower小写

3.concat连接字符串https://blog.csdn.net/Ajdidfj/article/details/123246593

4.left取字符串左边几位,right取字符串右边几位

全部评论

相关推荐

牛马43373018...:这人真懂什么叫熵吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务