Link to home
Start Free TrialLog in
Avatar of searchsanjaysharma
searchsanjaysharma

asked on

How to join multiple tables with aggregated outout.

I am using this command given by one of the experts to get the desired output on the basis of state,district,source.
Here there is only 2 tables.Similarly i want to append the result from other tables say t1 and t2 to this query, joining to be done on same fields.
select state,district,source,
count(
       CASE
         WHEN rfeeddate between '2012-3-1' and '2012-3-31' THEN 1
         ELSE NULL
       END) as cnt,
count(
       CASE
         WHEN rfeeddate<='2012-3-31' THEN 1
         ELSE NULL
       END) as cntTill
from mstchvs where flagr=1 and
group by state,district,source
order by 1,2,3
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of searchsanjaysharma
searchsanjaysharma

ASKER

I am not able to achieve it.Kindly help with query