取出日期这个字段的最大日期的前10条记录

yzaiml 2007-09-07 11:37:59
SELECT financial.effDate,financial.appDate,price.fundName,
price.bidPrice, price.offerPrice, financial.unitNum ,financial.accUnitNum * price.offerPrice AS InvestPrice
FROM financial INNER JOIN price ON financial.fundId = price.fundId
WHERE (financial.contractNo = 'BB00001001') and (price.transCode='00' )

这是现在的sql
我要取出 financial.effDate 这个字段前10条 日期最大的记录
...全文
213 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Limpire 2007-09-07
  • 打赏
  • 举报
回复
SELECT TOP 10 financial.effDate,financial.appDate,price.fundName,
price.bidPrice, price.offerPrice, financial.unitNum ,financial.accUnitNum * price.offerPrice AS InvestPrice
FROM financial INNER JOIN price ON financial.fundId = price.fundId
WHERE (financial.contractNo = 'BB00001001') and (price.transCode='00' )
ORDER BY financial.effDate DESC
leo_lesley 2007-09-07
  • 打赏
  • 举报
回复
SELECT top 10 financial.effDate,financial.appDate,price.fundName,
price.bidPrice, price.offerPrice, financial.unitNum ,financial.accUnitNum * price.offerPrice AS InvestPrice
FROM financial INNER JOIN price ON financial.fundId = price.fundId
WHERE (financial.contractNo = 'BB00001001') and (price.transCode='00' )
order by financial.effDate desc
yzaiml 2007-09-07
  • 打赏
  • 举报
回复
服务器: 消息 107,级别 16,状态 3,行 1
列前缀 'financial' 与查询中所用的表名或别名不匹配。
青锋-SS 2007-09-07
  • 打赏
  • 举报
回复
select top 10 effDate from
(SELECT financial.effDate,financial.appDate,price.fundName,
price.bidPrice, price.offerPrice, financial.unitNum ,financial.accUnitNum * price.offerPrice AS InvestPrice
FROM financial INNER JOIN price ON financial.fundId = price.fundId
WHERE (financial.contractNo = 'BB00001001') and (price.transCode='00' )) t
order by effDate desc
青锋-SS 2007-09-07
  • 打赏
  • 举报
回复
select top 10 financial.effDate from
(SELECT financial.effDate,financial.appDate,price.fundName,
price.bidPrice, price.offerPrice, financial.unitNum ,financial.accUnitNum * price.offerPrice AS InvestPrice
FROM financial INNER JOIN price ON financial.fundId = price.fundId
WHERE (financial.contractNo = 'BB00001001') and (price.transCode='00' )) t
order by financial.effDate desc

22,301

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧