mysql - How to solve mysql nested query?
问题描述
This is my query and output. Now i try to count total sum of unique item_id and name with this
SELECT name, SUM(item_id)
FROM (SELECT *
FROM items U
JOIN users_items UI ON UI.item_id = U.id)
but it shows error
解决方案
Do you find something below
select name, sum(item_id) FROM items U
JOIN users_items UI ON UI.item_id = U.id
group by name
推荐阅读
- visual-studio-code - 命令“重新加载 Vibrancy”导致错误(运行贡献的命令:“extension.updateVibrancy”失败。)
- javascript - 在任何桌面上滑动的全屏 HTML 页面
- reactjs - 从 Flask 到 React.js 的回调函数
- javascript - 如何获取位于表 td 中的输入字段值
- python - 在条形图中保存绘图图像
- javascript - 为什么 getComputedStyle() 方法在我的 Nuxt 应用程序中无法正常工作?
- javascript - 在jQuery中获取复选框插入输入值
- php - Symfony 5.3 密码哈希从“$argon2id”改回“$2y$13”
- django - 如何在 IIS 10 上为 Django 服务器配置 HTTPS
- python - 如何将多边形的边缘作为 LineStrings?