(select a,b,c from TABLE1) union all (select a,b,c from TABLE2)
쿼리의 결과 갯수를 구하고 싶습니다.
하나면 select count(*) from TABLE 해서 갯수를 구하지만 union all 하여 합친 쿼리결과의 갯수는 어떻게 구하는지요.
mysql_num_rows함수를 쓰면 되긴되네요..^^
subquery 가 지원되는 mysql 버전이라면 아래와 같이 하면 됩니다.
select count(*) from (select a,b,c from TABLE1 union all select a,b,c from TABLE2)zz;