Microsoft
Software
Hardware
Network
Question : Grab last two lab results
I need to grab the last two lab results from a table by date. How do I do this? I can grab max but not sure how to grab the last two. If there are 10 results I just want the last two
Answer : Grab last two lab results
select * from
(
select *,
rn=row_number() over (partition by patientid order by date desc) -- rank for each patient by latest date
from tbl
) SQ
where rn<=2 --- only top 2
Random Solutions
How to choose better iSCSI server software for cluster
recommended swap space
Populate table with dates stored as integers
What to buy for Student laptop, to be used for Visual Studio .Net development
viewing active cookies in IE
DNN module installation error
Convert DBtimeStamp to Date in Crystal 8.5
spryMenuBar not supported by my provider.
iPad Mobile Browsing
How do I enable the Create Email button in Access 2007 forms?