V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  nig001  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2022-11-18 11:59:47 +08:00
回复了 qiyong 创建的主题 程序员 面试中遇到的一道 sql 题
SELECT a.id,a.name,c.sales_volume,gb.group_name,gb.g_sales_volumes FROM goods a LEFT JOIN goods_sales_record c ON a.id = c.goods_id LEFT JOIN (SELECT b.id as group_id,b.name AS group_name,sum(c.sales_volume) AS g_sales_volumes FROM goods_sales_record c LEFT JOIN goods a ON a.id=c.goods_id LEFT JOIN goods_group b ON a.group_id = b.id GROUP BY b.id) gb ON a.group_id = gb.group_id ORDER BY gb.g_sales_volumes,c.sales_volume DESC LIMIT 3
2020-08-03 14:43:53 +08:00
回复了 KalaSearch 创建的主题 程序员 优秀的 REST API 设计指南
不错的
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1188 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 18:19 · PVG 02:19 · LAX 11:19 · JFK 14:19
Developed with CodeLauncher
♥ Do have faith in what you're doing.