Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Returning null while doing max(date).

842894Feb 25 2011 — edited Feb 26 2011
HI,

i would like to find the latest paid date for particular period.

select max(paymentdate) last paid,period form table
group by period.



for example
i have two columns with data.

period paymentdate
feb 10/10/2010
feb 9/10/2010
feb null
march null
apr 11/10/2010
apr null

by excuting the above query it is returing following out put which is incorrect if the data has null for the same period it is returnign that row also. what is the best query to return only one row.

period paymentdate
feb 10/10/2010
feb null
march null
apr 11/10/2010
apr null
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2011
Added on Feb 25 2011
7 comments
1,227 views