开发者

PHP query join question

开发者 https://www.devze.com 2022-12-21 02:59 出处:网络
if i h开发者_开发技巧ave a table that looks like this: sample_iddatesample_number 121-24-105 091-25-102

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

精彩评论

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