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
operation on JTable
Installing iTunes9 on Win XP Pro x64 bit OS
Sync between BIND and Microsoft DNS
Exchange 2003 MSADC errors 8064 8108
Add permissions to user's home directories
CountIf in Excel across many cells
After installing desktop experience on 2008 RDP server outlook is no longer default mail program HELP!
How to register regsrv32 DLLs in remote machi by using delphi 7 program
How to use PIVOT function
How to install fonts in Windows 7, using VFP 9.0