Start New Discussion within our Software Development Community

I use Visual Basic 2008 with Mysql
I have a table article with the following data :

Articlenb - Productcode - amount
1 - XXL - 1
2 - 12 - 1
3 - 10 - 1
4 - 1.5 - 1
5 - 7 - 1
6 - 4 - 1
7 - 1 - 1
8 - 1.5 - 1
9 - 7 - 1
10 - 4 - 1
11 - 1.5 - 1

To get this list below a have use this query :

Select articlenb , productcode, sum(amount) from article group by productcode

But i want to sort the list by productcode like this and i must use group by!!!


Articlenb - Productcode - amount
7 - 1 - 1
4 - 1.5 - 3
6 - 4 - 2
5 - 7 - 2
3 - 10 - 1
2 - 12 - 1
1 - XXL - 1

How can i achieve this?

Thanks,

André

Select articlenb , productcode, sum(amount) from article group by productcode order by productcode
This question has already been answered. Start a new discussion instead.