I want first two lines show up from the query
iddischargedatefinalraceyear
00001112010-12-04O2010
00001112009-12-22O2009
00001112009-03-13I2009
#racetest table also has
iddischargedatefinalraceyear
00001112010-12-04O2010
00001112009-12-22O2009
00001112009-03-13I2009
drop table #racetest1
select distinct mrn,
max(dischargedate)as dischargedate,
finalrace,
year
into #racetest1 from #racetest
group by mrn ,
finalrace,
year
order by dischargedate desc, year
Any help would be appreciated!,
thanks,
Haimanti