年份 | 销售 |
---|---|
2021 | 1000 |
2022 | 1500 |
2023 | 2000 |
我想用窗口功能显示第三列最小销售额。但年份=2022。
年份 | 销售 | 分钟 |
---|---|---|
2021 | 1000 | 1500 |
2022 | 1500 | 1500 |
2023 | 2000 | 1500 |
我尝试了以下查询,但没有返回所需的结果:
select *,min(sales) over (partiton by year=2022) from table
与窗口函数没有任何关系:
select *
from "table",
(select min(sales) as minSale from "table" where year = 2022) x;