题解 | #获取Employees中的first_name#

获取Employees中的first_name

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

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

假设first_name是mysql,length(mysql)=5,length(mysql)-1=4,substr(mysql,4)索引从1开始,4是q,没有说明取多少个字符则取到结束,结果是ql 假设first_name是first_name,length(first_name)=10,length(first_name)-1=9,substr(first_name,first_name)索引从1开始,9是m,没有说明取多少个字符则取到结束,结果是me

全部评论

相关推荐

点赞 评论 收藏
分享
双尔:你就写拥有ai开发经历,熟练运用提示词,优化ai,提高ai回答质量
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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