Hi,
select * from tableA a where
1 >= (select count(distinct edate) from tableA b
where b.no_property = a.no_property
and b.company = a.company
and b.edate > a.edate
)
The above query table have around 10million rows. I need to get info of last 2 max edate for each no_property and company of tableA.
This query took me around 4 hrs and not completed successfully.
Pl. give your suggestions on the above query.
Thanks in advance.
Raj
select * from tableA a where
1 >= (select count(distinct edate) from tableA b
where b.no_property = a.no_property
and b.company = a.company
and b.edate > a.edate
)
The above query table have around 10million rows. I need to get info of last 2 max edate for each no_property and company of tableA.
This query took me around 4 hrs and not completed successfully.
Pl. give your suggestions on the above query.
Thanks in advance.
Raj