if i h开发者_开发技巧ave a table that looks like this:
sample_id date sample_number
12 1-24-10 5
09 1-25-10 2
12 2-14-10 5
How can I join both (sample_id:12)'s ?
sample_id:12 has a total of 10 sample numbers.
SELECT SUM(`sample_number`) FROM `table` GROUP BY `sample_id`;
Should do it.
精彩评论