You didn't way which version of SQL Sever you are using, but one way is with the ROW_NUMBER() function:select *
from
(
select
employee,
fld_nbr,
date_stamp,
ROW_NUMBER() OVER (PARTITION BY employee ORDER BY date_stamp DESC) AS RowNum
from
hrhistory
Where
fld_nbr = '2'
and date_stamp > (sysdate-30)
) as t
where
RowNum IN (1, 2)