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
Server upgrade question
Anyone know what a "place message" is?
Help adding image to Crystal Report
Hard drive disappeared
Trim first five characters from string
SQLserver2005 backup, recovery and log shipping
Syntax to use user defined criteria in update routine
include files not found
WP Loop: Incorrect Number of Posts on Home Page - How to Reset Loop Counter
I can't seem to add separators or other items to my bookmark folder in Firefox