Mega Code Archive

 
Categories / MySQL / Table Index
 

Copy table with calculation

INSERT INTO dst_tbl (i, s) SELECT COUNT(*), name FROM src_tbl GROUP BY name;