mysql - When not to use SQL Cursors and joins -
using mysql, have table
table 1
id d -------- 100 125 50 b 50 b 25 c 5 c 50 c 50
i need new table: sum id's = id's
table new
id d -------- 275 b 75 c 105
how using cursor id's?
how using joins , temp table?
insert table2 (id, d) select id, sum(d) table1 group id
why use of other methods both inefficient , more complicated write?
Comments
Post a Comment