Should be a simple query, please help a desperate person at the end of their pitiful rope.

From: Ryan McLean <rdm32_at_dana.ucc.nau.edu>
Date: 5 Jun 2003 16:45:35 -0700
Message-ID: <dfec50f9.0306051545.3cfb9bbf_at_posting.google.com>


I am trying to return one of two records. The most recend one . . . why does this not work?

SELECT *
FROM PARKING_SERVICES_ADM.VEHICLE_INFO
WHERE RES_PERSON_ID = '8675309'
AND ROWNUM < 2
ORDER BY PERMIT_PURCHASE_DATE DESC; This should be an easy answer . . . thank you in advance for any help.

Thanks,

Ryan

p.s. the result is the other (wrong) record. This record has an older PERMIT_PURCHASE_DATE, I thought the query above would return the latest record according to the PERMIT_PURCHASE_DATE field. If I change the rownum < 2 to rownum < 3, I get the correct order of the rwo records.

Thanks again! Received on Fri Jun 06 2003 - 01:45:35 CEST

Original text of this message