mysql 高手进: 跪求:查询createdate创建日期最新的那条数据

查出来的就是最新(createdate)的那条数据,appno重复的去掉 select top 1 * from table_name order by createdate desc显示的就是最新的那条select max(createdate) from 表名因为其他的值都一样,所以你只要查最新的时间是多少就可以了
mysql 高手进: 跪求:查询createdate创建日期最新的那条数据
select a.*
from file_prc a,
(
select AppNo,max(createdate) createdate from `file_prc`
where flag = '1'
group by AppNo
) b
where a.flag = '1' and a.AppNo=b.AppNo
and b.createdate = a.createdate;

查出来的就是最新(createdate)的那条数据,appno重复的去掉2008-12-22
select top 1 * from table_name order by createdate desc

显示的就是最新的那条2008-12-22
select max(createdate) from 表名

因为其他的值都一样,所以你只要查最新的时间是多少就可以了2008-12-22
mengvlog 阅读 9 次 更新于 2025-07-20 19:59:45 我来答关注问题0
檬味博客在线解答立即免费咨询

mySQL相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部