SQL中的分组和总结
美好的一天,
我想找出如何通过对帐户进行分组并总结帐户每月的孙子来对以下数据进行分类和分组。
这是我当前的选择语句:
SELECT
tbl_AccountLedger.ledgerName
,tbl_SalesMaster.date
, tbl_SalesMaster.grandTotal
FROM tbl_SalesMaster
INNER JOIN tbl_AccountLedger ON tbl_SalesMaster.ledgerId =tbl_AccountLedger.ledgerId
这是WAT我的选择语句带回
现在,我需要通过将每个月的grand总计用于legerName来对这些数据进行排序
Good day
I would like to find out how I would Sort and group the following data by grouping the Account and summing the grandTotal of the Account per Month.
This is my current Select statement:
SELECT
tbl_AccountLedger.ledgerName
,tbl_SalesMaster.date
, tbl_SalesMaster.grandTotal
FROM tbl_SalesMaster
INNER JOIN tbl_AccountLedger ON tbl_SalesMaster.ledgerId =tbl_AccountLedger.ledgerId
Here is wat my select statement is bringing back
Now I need to sort this data by summing the grand total for each month for a legerName
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在SQL 2012或更高版本上使用以下查询。我建议请阅读SQL中的分组。
You can use the below query on SQL 2012 or higher version. I will suggest please read grouping in SQL.