如果是SAS, 不用那麽複雜。不是SAS,下麵的SQL就不行了。 select min(begdate) as begdate, enddate from sometable having enddate = max(enddate);