【发布时间】:2022-01-04 23:59:55
【问题描述】:
我想知道 NUMERIC(5,2) 相对于我的 avg 的正确位置在下面的 SQL 查询中:
select distinct
b.name, avg(c.price) over (partition by b.name) as average_price
from
Catalog a
join
books b on (a.book_id = b.id)
join
movies c on (a.movie_id = c.id)
where
c.price is not null
and a.record >= 2
group by
b.name, c.price, average_price
我已经尝试过任何地方的感觉!
提前致谢。
【问题讨论】:
标签: sql group-by average numeric partition