题解 | 顾客登录名
select
cust_id,
cust_name,
# 全部大写
upper(
# 拼接
concat (
# SUBSTRING(column_name, start, length)
# column_name:要从中提取子字符串的字段名或字符串表达式。
# start:子字符串的起始位置(从 1 开始计数)。
# length:要提取的子字符串的长度。
substring(cust_contact, 1, 2),
# 根据字段内容切分取值
substring_index (cust_city, ' ', 1)
)
) as user_login
from
Customers