Consider
 
SQL> select deptno from emp, dept;
select deptno from emp, dept
       *
ERROR at line 1:
ORA-00918: column ambiguously defined
 
The column deptno would be checked against one of the tables and would be found to
be valid, but the checking cannot stop there. The other table must also be checked for
a possible conflict ( which there is in this case ).
 
 
select d.deptno from emp e, dept d;
 
Does not just resolve the conflict, it removes the need for any checking on emp.
 
Any column which is not aliased will have to be checked against ALL tables mentioned,
so aliasing can save quite a lot of time.
 
Regards
 
Garry 
 -----Original Message-----
From: novicedba [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2001 12:11
Hi,
  was reading CorrelatedSubqueries.pdf from oriole corp.
In fact it's good programming practice to use aliases in every situation where more than one table is referred to in a statement, since it saves time when parsing.
 
Can some one please explain how it helps?
++++++++++++++++++++++++++++++++++++
All internet traffic to this site is 
automatically scanned for viruses 
and vandals.
++++++++++++++++++++++++++++++++++++

Reply via email to