mysql - 使用 DENSE_RANK() MySQL 缺少右括号
问题描述
我不确定我的语法在哪里出错。我需要根据以下条件显示顶级供应商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
解决方案
where a1.ranking = 1
为 SQL 的外部添加:
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;
推荐阅读
- r - 为桑基图构建交易数据
- codeigniter - 表格中的多行打印
- r - ggplot geom_point 绘制两个分类变量并填写缺失
- html - How to ensure Script sends an email containing an HTML table with full range of data?
- docker - docker - RHEL 上的 docker-credential-secretservice
- mysql - 如何在联结表上插入值
- python - 您可以免费使用 Google Geocoding API 多少次?
- opengl - 如何在感知投影中渲染大小恒定的圆?
- sql - 如何在 SQL DW 中使用汇总分组函数错误?
- ipad - 使用移动设备时如何在 colab 上使用方向箭头键?