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
proc and package for simple code
c declaration type
DropDownList value does not get inserted into sql table
Sharing Contacts with Outlook 2003
any new CAPTCHA framework??
Split String with Delimiter
Exchange Remove Public Folder Client Permissions
DIV issues in IE
Removing the dash in telephone number
jQuery Autocomplete with PHP / MySQL [PART 4 continued...]