文章目录 1. 题目2. 题解 1. 题目 题目来源:SQL52 获取employees中的first_name 题目描述 将employees中的first_name,并按照first_name最后两个字母升序进行输出。 一张表 所需结果 2. 题解 考察字符串函数,可以使用RIGHT(s, n)或者SUBSTRING(s, i, n) 1、使用 RIGHT() SELECT first_name FROM employees ORDER BY RIGHT(first_name, 2) ASC 2、使用SUBSTRING() SELECT first_name FROM employees ORDER BY SUBSTRING(first_name, -2, 2) ASC