Very nice. Worked perfectly. Now I need to incorporate more columns in this query. Here is what I have:
select TOP(2) t.auditkey, t.mtttaxcode, t.MttTaxPercentOverBase, t.mttNonResidentTaxRate, t.mttAmtOverWageBase,
t.MttDateTimeChanged, t.mttIfWageBaseIsOver, t.MttIfWageBaseIsOver, c.mtcReciprocityLimit
from txtbmast t join txcdmast c
on t.mtttaxcode = c.mtctaxcode
where mtttaxcode in
(
'MI001','MI002','MI007','MI008','MI013','MI015','MI016','MI019','MI020','MI026','MI027','MI028','MI034','MI037','NMWCEE'
,'NMWCER','NY001','NY006','PA100018','PA102092','PA103015','PA112826','PA113485','PA113628','PA117759','OR001','ORWCEE','WALIEE'
,'WALIER','WASEAER' ,'PA100045','PA108094','PA111185','NMWCEE','NMWCER','PA104041','WALIEE','WALIER','IN174'
,'MD011','MD016','OH1005','OH1034','OH1055','OH1102','OH1172','OH1229','OH1278','OH1445','OH1541'
,'OH1762','OH1794','OH181','OH1844','PA100292'
)
ORDER BY t.auditkey DESC
I need to pull the 2 highest auditkey's for each of the values in the where clause. Right now if I run it, it will only pull in 2 records.