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[6]: to_number question

Re[6]: to_number question

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Mon, 19 Jul 2004 08:39:30 -0400
Message-ID: <726016671.20040719083930@gennick.com>


Monday, July 19, 2004, 8:24:02 AM, Mercadante, Thomas F (thomas.mercadante_at_labor.state.ny.us) wrote:

MTF> Please please please keep distracting us with your unease about how things
MTF> work.  I know I learn a lot reading every single stinkin word you put on
MTF> this list, as well as what you publish.

I'm almost afraid to post this next question, but here goes.

Here's that same old query with a subquery:

SELECT *
FROM ( SELECT flag, TO_NUMBER(num) num

       FROM subtest
       WHERE flag IN ('A', 'C') )

WHERE num > 0;

I can now accept that "num > 0" might be applied to rows that are not returned by the subquery. I have no problem anymore with that happening. I've been converted.

Ok. So. Let's zoom in on the subquery for a moment:

       SELECT flag, TO_NUMBER(num) num
       FROM subtest
       WHERE flag IN ('A', 'C')

If there is no ordering at all to SQL, then do I also need to accept the possibility here that TO_NUMBER(num) might be evaluated for a row in which flag is other than 'A' or 'C'? In other words, can functions in the SELECT list be evaluated on rows *before* those rows have been determined to fall into the result set? Does the SQL standard have anything to say about this particular question?

Best regards,

Jonathan Gennick --- Brighten the corner where you are http://Gennick.com * 906.387.1698 * mailto:jonathan@gennick.com

Join the Oracle-article list and receive one article on Oracle technologies per month by email. To join, visit http://five.pairlist.net/mailman/listinfo/oracle-article, or send email to Oracle-article-request_at_gennick.com and include the word "subscribe" in either the subject or body.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Mon Jul 19 2004 - 07:36:14 CDT

Original text of this message

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