>>데커드 님께서 쓰시길<<
:: 예를 들어
:: select count(*) from test where test_no =12
:: 의 값과
:: select count(*) from test2 where test2_no = 10
:: 의 값의 합을 한번에 구할 수 있는 쿼리를 만들 수 있나요?
select first+second
from (
select
(select count(*) from test where test_no=12) as first,
(select count(*) from test2 were test2_no=10) as second
from dual
);
위처럼 다중 쿼리로 하면 원하는 결과를 얻으실수 있을듯.
같은 테이블이라면 GROUP BY로도 될텐데요. 테이블이 달라서 좀 까다롭네요.
|