問題有缺陷
如果一個max(recordDate) 有多個價格怎麽辦?
select t.acccountID, a.mDate, t.price
from table t
(select acccountID, max(recordDate) as mDate
from table
group by acccountID) as a
where t. acccountID=a. acccountID
and t. recordDate=a.mDate
group by t.acccountID, a.mDate, t.price