题解 | #顾客登录名#concat substring
顾客登录名
https://www.nowcoder.com/practice/7cbf5e3082954c21a80fc750ce97350f
select cust_id, cust_name, upper(concat(substring(cust_name,1,2),substring(cust_city,1,3))) as user_login from Customers # 提取前2个字符 # substring(str,1,2) # 提取前3个字符 # substring(str,1,3) # SUBSTR(cust_contact,1,2) # SUBSTR(cust_city,1,3) # 字符串的截取:substring(字符串,起始位置,截取字符数) # 字符串的拼接:concat(字符串1,字符串2,字符串3,...) # 字母大写:upper(字符串)
SQL错题 文章被收录于专栏
每天学习一遍 刷题刷题 越刷越强!