给列取一个其他名字,方便自己认识
select t.empno, t.ename from scott.emp t;
select t.empno, t.ename as 名字 from scott.emp t;
列名上显示名字两个字
给临时结果取名字
select t.deptno, count(*) from scott.emp t group by t.deptno;
select t.deptno, count(*) as total from scott.emp t group by t.deptno;
给临时结果用于嵌套查询使用
经典的分页查询
select * from (select t.*, rownum as rn from scott.emp t where rownum < 6) t where t.rn > 3