我不确定在这里我的语法哪里错了。我需要显示基于invoice_total
的顶级供应商
select *
from (
select vendor_id, invoice_total,
dense_rank () over(partition by vendor_id order by invoice_total asc)
as ranking
from invoices) a1
发布于 2018-06-10 07:37:05
为SQL的外部添加where a1.ranking = 1
:
select *
from (
select vendor_id, invoice_total,
dense_rank () over(partition by vendor_id order by invoice_total asc)
as ranking
from invoices) a1
where a1.ranking = 1;
https://stackoverflow.com/questions/50779401
复制相似问题