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
Broadcast Addressing Schemes
Need assistance with filtering a report from a form
DFS Replication
Read XML through LINQ
C #DBNULL
IIS Windows 7 500 - Internal server error. with ASP.NET C# Application
Problem with databound ComboxColumn in a Databound DatagridView. HELP :-(
Combination generator
E-Machines EL1200 BSOD at Startup - Windows XP SP2
Javascript to force a "scroll to the top of page" upon page load