问题:
select ename from emp ;
+--------+
| ename |
+--------+
| ALLEN |
| WARD |
| MARTIN |
| BLAKE |
| CLARK |
| KING |
| TURNER |
| JAMES |
| MILLER |
+--------+
如上的记录中按照每个姓名的最后两个字符排序:
select ename from emp
order by substr(ename,length(ename)-1,2);