3개의 테이블에서 자료를 빼어 합계를 구하는것인데요..
$sum1= mysql_fetch_array(mysql_query("select sum(count) from
table1 where no='1'"));
$sum2= mysql_fetch_array(mysql_query("select sum(count) from
table2 where no='2'"));
$sum3= mysql_fetch_array(mysql_query("select sum(count) from
table3 where no='3'"));
위 방법과 유니온으로 테이블을 모두 합친후 for문으로 합계가
좋을까요??
|