top新手问题!!! select 零件名称,max(采购日期) from 表 group by 零件名称 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from 表 awhere 采购日期 = ( select top 1 采购日期 from 表 where 零件名称 = a.零件名称 order by 采购日期 desc ) select 零件名称,采购价格 from 表 where 采购日期 in(select max(采购日期) from 表 group by 零件名称) select a.零件名称,a.采购价格 from tablename a join ( select 零件名称, max(采购日期) as 日期 from tablename group by 零件名称 ) b on a.零件名称=b.零件名称 and a.采购日期=b.日期 SQL执行 关于函数的一点不理解 求救~~更新的问题~先谢了~ 帮我看一下这个存储过程到底有什么问题? 这样的查询语句怎么写? 一个错误提示 [请教] 模糊检索功能是如何实现的? sql server 2000在windowsxp下的安装? 怎样安装和配置数据库开发环境? 数据库备份,恢复过程,是否对数据库本身的性能产生影响,是否会对服务器性能造成影响,谢谢! 日期,字符串函数? 请教,sql2000中数据库已建立,在企业管理其中能够操作数据,为何在企业查询分析其中连接不上?
where 采购日期 = ( select top 1 采购日期 from 表 where 零件名称 = a.零件名称 order by 采购日期 desc )
select a.零件名称,a.采购价格
from tablename a join
( select 零件名称, max(采购日期) as 日期
from tablename
group by 零件名称
) b on a.零件名称=b.零件名称 and a.采购日期=b.日期