Home > database >  Specify rows together
Specify rows together

Time:11-08

Finterid fitemid fqty
3050 45946 800
3050 45946 600
3051 45964 4000
3051 45968 800
3051 45976 3250
3051 45976 36100
3051 45976 9650


How to write in the SQL statement for the above data, implement
The following effects: (same fitemid fqty addition)
Finterid fitemid fqty
3050 45946 1400
3051 45964 4000
3051 45968 800
3051 45976 49000

CodePudding user response:

 
The SELECT finterid fitemid, SUM (fqty) fqty FROM table name GROUP BY finterid, fitemid

CodePudding user response:

Thank you very much! Can the
  • Related