My query returns 4 records, with one column is datetime. I want to get first record from the set of records. Query is
============ Query ==============
select Last_Modified, Service_Name, Service_Type_ID, Service_Subtype, Service_Status_Code, Active_Date
from service_history
where to_date (Last_Modified) <= '20-aug-01' and Service_Type_ID = 1845 and Service_Name = '03335100094'
and (Service_Status_Code in (3, 6, 9))
order by Service_Name, Last_Modified desc
=========== End Query ==========
If I include rownum = 1 then it doest not show accurate results as the required rownum is 4 rather then to be 1. Also I want to get record from that query with highest date.
Please help Amer
============ Query ==============
select Last_Modified, Service_Name, Service_Type_ID, Service_Subtype, Service_Status_Code, Active_Date
from service_history
where to_date (Last_Modified) <= '20-aug-01' and Service_Type_ID = 1845 and Service_Name = '03335100094'
and (Service_Status_Code in (3, 6, 9))
order by Service_Name, Last_Modified desc
=========== End Query ==========
If I include rownum = 1 then it doest not show accurate results as the required rownum is 4 rather then to be 1. Also I want to get record from that query with highest date.
Please help Amer