如何在下面的描述中解决这个问题。请我的软件也完成,但这个问题没有解决 [英] How to solve this problem in below description.and please my software is also done but this problem are not solve

查看:64
本文介绍了如何在下面的描述中解决这个问题。请我的软件也完成,但这个问题没有解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的系统出现问题。我的数据库上有一个名为Purchase的表。这是表格的图片。

I have a problem with my current system. I have a table named Purchase on my database. This is the picture of the table.

1/12/2016 25000
1/18/2016 5000
2/4/2016  5000
3/5/2016  6000
3/10/2016 5000





如你所见,我有与1月和3月相同的购买细节。但我希望结果集值如下:



As you can see, I have the same details of purchase for the month of Jan and March. But I wanted the resultsetvalue to be like this:

jan    30000 like
feb    5000 or
march  11000



请帮助我vb.net中的任何人



我尝试了什么:



i已经尝试在vb.net 2010和后端mysql,我的软件在线


Please help me anyone in vb.net

What I have tried:

i have try in vb.net 2010 and backend mysql and my software is online

推荐答案

使用GROUP BY和聚合SUM函数:

Use GROUP BY and the aggregate SUM function:
SELECT DATE_FORMAT(dateColumn, "%m-%Y") AS Month, SUM(ValueToAggregateColumn)
FROM MyTable
GROUP BY DATE_FORMAT(dateColumn, "%m-%Y")

这篇关于如何在下面的描述中解决这个问题。请我的软件也完成,但这个问题没有解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆