kjtocool Posted June 5, 2008 Share Posted June 5, 2008 Table data looks something like so: prod_id - ver_id - total_num 1 - 11 - 34 1 - 11 - 28 1 - 11 - 45 1 - 12 - 27 1 - 12 - 87 1 - 14 - 97 1 - 14 - 28 2 - 11 - 28 2 - 11 - 76 2 - 12 - 87 and so on. Essentially what I want to return is: 1 - 11 - Sum of all 1 - 12 - Sum of all 1 - 14 - Sum of all 2 - 11 - Sum of all 2 - 12 - Sum of all How would I go about this? Select prod_id, ver_id, SUM(total_num) Group By ver_id, prod_id? Quote Link to comment Share on other sites More sharing options...
Barand Posted June 5, 2008 Share Posted June 5, 2008 almost Select prod_id, ver_id, SUM(total_num) Group By prod_id, ver_id Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.