题解 | #创建一个actor_name表#

获取employees中的first_name

http://www.nowcoder.com/practice/74d90728827e44e2864cce8b26882105

要使用 first_name 后面的两个字符排序,第一时间就想到要使用截取的操作

select first_name
from employees
order by substr(first_name, length(first_name) - 1);

看评论区后,发现有更优雅的实现方式

select first_name from employees order by right(first_name,2);

select first_name from employees order by substr(first_name,-2);
全部评论

相关推荐

2025-12-17 18:11
中山大学 后端工程师
Yilena:自我评价去掉,项目亮点不是这么写的,基本是技术栈+简单思路,每点一两行就行。简历缩到一页就行了,中大学历还说啥了,乱投都有offer
实习简历求拷打
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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