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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Avoiding New Fields Causing Ambiguity Errors

Re: Avoiding New Fields Causing Ambiguity Errors

From: Tokunaga T. <tonkuma_at_jp.ibm.com>
Date: 14 May 2002 05:33:02 -0700
Message-ID: <8156d9ae.0205140433.45dd1d4c@posting.google.com>


>
> It seems that some database engines don't let one use
> alias columns within WHERE clauses for some odd
> reason. I often get "invalid column" when I try to do
> this. Thus, I have to resort to the "native" name
> with a table/entity qualifier in WHERE clauses.
> This works, but makes generated
> criteria code more difficult to manage because
> the result set column name differs from the
> criteria column name.

This is not the odd reason, in my opinion. The sequence of evaluation of each clause in a select statement is defined by SQL Standards, and perhaps implemented strictly in some DBMSs.
Without these defined sequence, the result of a query may be unpredictable or cause error.
For example, an expression in a select clause may cause an error if evaluated appropriately before filtering out rows by where clause. Received on Tue May 14 2002 - 07:33:02 CDT

Original text of this message

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