更新时间:2022-12-09 22:25:37
一个简单的group by
应该可以工作:
A simple group by
should work:
select cast(price_set_date as date) as [Date]
, exch_ticker
, min(buy_price) as MinPrice
, max(buy_price) as MaxPrice
from price_details as p
group by
exch_ticker
, cast(price_set_date as date)
不确定为什么您的示例查询使用自连接.如果有充分的理由,请在您的问题中添加解释.
Not sure why your example query is using a self join. If there's a good reason please add an explanation to your question.