建议同一张表,进行联合查询。 eg: select name from user a where 0 = ( select count(*) from user where id = a.id and createTime > a.createTime ) order a.createTime desc 大体思路就是一张表先降序,然后另外一张表与这张表时间做比较,看count值,确定是否是最新数据。 最新的一条数据就出来了
建议同一张表,进行联合查询。
eg:
大体思路就是一张表先降序,然后另外一张表与这张表时间做比较,看count值,确定是否是最新数据。
最新的一条数据就出来了