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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Is this an bug in Oracle's SQL compiler

Re: Is this an bug in Oracle's SQL compiler

From: Matthew Fuller <matthewlf_at_my-deja.com>
Date: Fri, 26 Jan 2001 13:32:25 GMT
Message-ID: <94ru99$kac$1@nnrp1.deja.com>

In article <94ncma$niu$1_at_nnrp1.deja.com>,   jdorlon_at_my-deja.com wrote:
>
> >
> > MIN(CLIENT
> > ----------
> >
>
> This looks to me like it is returning a row that has a NULL value for
> the data you are selecing. If SQL*Plus does not return a row, it
> says 'no rows selected' (or something like that).
>
> Sent via Deja.com
> http://www.deja.com/
>

This is not correct when using summary functions such as MIN/MAX/SUM, etc. These will always return a value, even if it is NULL. Case in point, try the following:

SQL> create table empty_table(field1 number);

Table created.

SQL> select min(field1) from empty_table;

MIN(FIELD1)


SQL> select sum(field1) from empty_table;

SUM(FIELD1)


However, this will product a NO_DATA_FOUND event:

SQL> select * from empty_table;

no rows selected

Matt.

Sent via Deja.com
http://www.deja.com/ Received on Fri Jan 26 2001 - 07:32:25 CST

Original text of this message

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