posted 14 years ago
Hi Deepika,
one other purpose for table aliases is when you have a table twice in your select, then the use of aliases is mandatory.
E.g. if you know the table emp from the scott/tiger-scheme:
TABLE EMP
(EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7, 2),
COMM NUMBER(7, 2),
DEPTNO NUMBER(2));
If you want to select the employee names and the name of their manager:
select e1.ename,e2.ename from empe1,emp e2 where e1.mgr = e2.empno;
John