codice:select *, count(t1.scanner) as scanner, count(t1.stampanti) as stampanti from db1.tab1 as t1 inner join db2.tab2 as t2 ON t1.nome = t2.nome /// o quel che l'e', cognome, id ??? where .... // se ne esistono di condizioni group by t2.direzione order by ....