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

Home -> Community -> Usenet -> c.d.o.misc -> Re: alias - do i need to use?

Re: alias - do i need to use?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 13 Feb 2005 09:31:41 -0800
Message-ID: <1108315901.812802.286460@o13g2000cwo.googlegroups.com>


Besides Sybrand's accurately directed comments about actually trying the SQL and reading the manuals if you are using the standard DEPT table found in many Oracle examples then from memory I believe the correct column name is dname not d_name. What you probably meant to write was d.dname.

As a matter of good form you should alias the column names in the select list whenever you have a join so that whenever another developer reads the SQL statement he or she will know where the columns come from even without being familar with the tables. As long as all the columns names in the select list are unique amoung the tables in the join there is no technical requirement to alias the columns in the select list. The same is true for the where clause. When the same column name appears in two or more tables then you need to identify from which table the column is to be accessed from.

HTH -- Mark D Powell -- Received on Sun Feb 13 2005 - 11:31:41 CST

Original text of this message

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