关于报价的问题 标题说不清 不是一般的问题! :)

chenggn 2003-10-09 10:01:12
select * from mk_quote
where ProductId=1 And pDate = (Select Max(pDate) from mk_quote where ProductId=1)

select distinct productId from mk_quote where saler=1

怎么能将这两句合成一句?

第一局中的 prodcutid 从 第二局中取值
...全文
57 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenggn 2003-10-09
  • 打赏
  • 举报
回复
嘿嘿!! 第一个是对的

其它两个不对哦
sdhdy 2003-10-09
  • 打赏
  • 举报
回复
select * from mk_quote
where ProductId in (select distinct productId from mk_quote where saler=1) And pDate = (Select Max(pDate) from mk_quote where ProductId=1)
pengdali 2003-10-09
  • 打赏
  • 举报
回复
select * from mk_quote
where ProductId in (select distinct productId from mk_quote where saler=1) And pDate = (Select Max(pDate) from mk_quote where ProductId in (select distinct productId from mk_quote where saler=1))

愉快的登山者 2003-10-09
  • 打赏
  • 举报
回复
select * from mk_quote as A
where ProductId in (select distinct productId from mk_quote where saler=1) And pDate = (Select Max(pDate) from mk_quote where ProductId=A.ProductId)

34,588

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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