标签:
第二章 查询结果排序
2.1 按查询字段排序
select ename,job,sal from emp where deptno = 10 order by sal asc;
select ename,job,sal from emp order by deptno, 3 desc;-- 3表示sal
2.2 按子串查询
select ename,job from emp order by substring(job,length(job)-2);--按job的最后两个字符排序
2.3 对字符数字混合排序
create view v as select ename ||‘ ‘ ||deptno as data from emp;--创建视图 select * from v;
标签:
原文地址:http://www.cnblogs.com/weixiaole/p/4241806.html