题解 | #对过长的昵称截取处理#

对过长的昵称截取处理

https://www.nowcoder.com/practice/69243e2742bf47f1976db836860c123c

select uid, nick_name
from (
    select uid,concat(substr(nick_name,1,10),'...') as nick_name
    from user_info
    where char_length(nick_name)>13
    union 
    select uid,nick_name
    from user_info
    where char_length(nick_name)<=13
) as t
where char_length(nick_name) >10
order by uid

全部评论

相关推荐

码农索隆:谁问你了 举报了 删了,求你了 我要哭了 我一点也不眼红 我要跳楼
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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