I often find myself doing something along the following lines in sql server 2005 :
Step1:
create view view1 as
select count(*) as delivery_count, clientid from deliveries group by clientid;
Step2:
create view view2 as
select count(*) as action_count, clientid from routeactions group by clientid;
Step3 :
select * from view1 inner join view2 on view1.clientid = view2.clientid
Is it possible to obtain the same final result in only one statement, avoiding the creation of the views ?