You can first convert it to a matrix and then call avg
, which will calculate for each column. After that, you can aggregate by grouping according to the stock code and use toArray
.
select toArray(avg(matrix(BidPrice)))
from t
where date(DateTime) =2025.08.01
group by SecurityID