开发者

PHP query join question

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜