日期:2014-05-16  浏览次数:20505 次

获取某表最新的一条记录

根据创建时间获取某表最新一条记录sql

select
        nationplan0_.*  
    from
        nation_planinfo nationplan0_ 
    where
        nationplan0_.create_time=(
            select
                max(nationplan1_.create_time) 
            from
                nation_planinfo nationplan1_ 
            where
                nationplan1_.isdel<>1 
                and (
                    nationplan1_.create_time is not null
                )
        )

?

?

?

?

?