Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> SQL help
SQL> select CUSTOMER_NUMBER,INVOICEDATE
2 from order_history
3 order by CUSTOMER_NUMBER,INVOICEDATE;
CUSTOMER_N INVOICEDA
---------- ---------
1137065 10-AUG-06 1137065 10-AUG-06 1137065 17-AUG-06 1137065 17-AUG-06 1137065 18-AUG-06 1137065 18-AUG-06 1137065 21-AUG-06 1137065 22-AUG-06 1137599 19-AUG-06 1137599 19-AUG-06 1137599 20-AUG-06 1137599 20-AUG-06 1137599 22-AUG-06 1137599 22-AUG-06 1137599 23-AUG-06 1137599 23-AUG-06
16 rows selected.
How do I modify this SQL to find out the last 3 invoiceDATE for each customer without using PL/SQL?
CUSTOMER_N INVOICEDA
---------- ---------
1137065 18-AUG-06 1137065 21-AUG-06 1137065 22-AUG-06 1137599 22-AUG-06
Roger
This e-mail is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. Any review, dissemination, copying, printing or other use o
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Aug 24 2006 - 14:33:48 CDT
![]() |
![]() |