Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: table aliases save time when parsing??

RE: table aliases save time when parsing??

From: Gillies, Garry <garry_at_weir.co.uk>
Date: Tue, 10 Jul 2001 07:15:25 -0700
Message-ID: <F001.0034556E.20010710053611@fatcity.com>

<SPAN

class=238030411-10072001>Consider
<FONT color=#0000ff face=Arial

size=2> 
<FONT color=#0000ff face=Arial

size=2>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 ).
<FONT color=#0000ff face=Arial

size=2> 
<FONT color=#0000ff face=Arial

size=2> 
select
d.deptno from emp e, dept d;
<FONT color=#0000ff face=Arial

size=2> 
Does
not just resolve the conflict, it removes the need for any checking on emp.
<FONT color=#0000ff face=Arial

size=2> 
Any
column which is not aliased will have to be checked against ALL tables mentioned,
so
aliasing can save quite a lot of time.
<FONT color=#0000ff face=Arial

size=2> 
<SPAN

class=238030411-10072001>Regards
<FONT color=#0000ff face=Arial

size=2> 
Garry<SPAN
class=770113312-10072001> 
<SPAN

class=770113312-10072001> <FONT
face="Times New Roman">-----Original
Message-----From: novicedba
[mailto:novicedba_at_hotmail.com]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 <FONT   face="Times New Roman" size=3>parsin<FONT   face="Times New Roman" size=3>g.
   
  Can some one please explain how it

  helps?++++++++++++++++++++++++++++++++++++
All internet traffic to this site is
automatically scanned for viruses
and vandals.
++++++++++++++++++++++++++++++++++++
Received on Tue Jul 10 2001 - 09:15:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US