lundi 24 août 2015

Merge Rows data with matching columns data from SQLite table?

I want to query a table name Lines like this:

ID   Part        Count
---  ---------   ------------
1    5           234
2    5           846
3    5           234
4    6           585
5    6           585
6    7           465

and return the rows data like following :

 ID   Part        Count
 ---  ---------   ------------
 1    5           1314
 4    6           1170
 6    7           465

What I want is to merge the Count column value where Part column matches and return other rows as is.I know little about database and have tried many queries but not able to achieve the result that I want.

Aucun commentaire:

Enregistrer un commentaire