日期:2014-05-17 浏览次数:20493 次
select b.* from DutyInfo b
,
(select MAX(a.DutyDate) DutyDate,sign as sign
from DutyInfo a group by a.sign) a
where b.DutyDate=a.DutyDate
order by b.DutyDate
select MaxDate Dutydate,DutyName,sign
from (select DutyDate, DutyName,sign,MAX(DutyDate) over (partition by sign) MaxDate
from @DutyInfo
(条件)
) as a
where DutyDate=MaxDate
order by a.DutyDate