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
Hosting options for ASP.NET 4.0 and SQL 2008
Will this ram compatible with my existing ram?
AWK Inplace Edit? Not generate new file
backup file maintenance / cleanup.
DB complaince
getting colorbox(lightbox) to initialize onload
Help on calculating days in SQL script
System Center Essentials 2010 problem?
Out of memory or system resources. Close some windows or programs and try again
I need Windows XP Home Edition for my Sony Laptop OEM