Created
August 25, 2019 01:43
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
有一个销售记录表 包含了一些如下的内容 | |
name money date | |
(名称) (销售总额金额) (日期) | |
商品 A 100 2019 年 7 月 25 日 | |
商品 B 200 2019 年 7 月 25 日 | |
商品 C 300 2019 年 7 月 25 日 | |
商品 A 6600 2019 年 7 月 24 日 | |
商品 B 99800 2019 年 7 月 24 日 | |
最后想实现的是:通过 select name,sum(money) from Table where date>'2019 年 7 月 23 日' group by name desc | |
该语句得到的数据集 | |
商品 A 99900 | |
商品 B 6800 | |
商品 C 300 | |
然后返回前端进行展示,现在卡在 sql 语句会写,但是返回类型,用什么去放这 3 条数据,我查了一下资料还是不明白,有老哥给个方案吗 | |
我想的办法是用 List<商品> 去放,这样做是对的吗 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment