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 -> sql plus max function query

sql plus max function query

From: <sdgreenwood_at_ybs.co.uk>
Date: Mon, 01 Feb 1999 09:35:04 GMT
Message-ID: <793sg9$h6r$1@nnrp1.dejanews.com>


Max function query


select max(start_date)
from accounts
where ........etc....

If there are no rows to satisfy the above query sql plus does not say 'No Rows Selected'.

If I ran the above query without the max function 'No Rows Selected' is displayed.

The problem is that if the above query is set up in a cursor then %notfound would not work, therefore processing would continue without testing whether any rows have been found.

I know that putting NVL(max(start_date,sysdate)) would work, but can anybody tell me why the max function works differently.

Thanks in anticipation,

SDG -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Feb 01 1999 - 03:35:04 CST

Original text of this message

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