I think I a bit over my head here, but can some take a look at the code and give me suggestion how to write this better.
thanks
thanks
Code:
select sum (case when count(*)<> 0 then 1 else 0 end)
from (
select fname + lname+ address + city+ state+ cast(zip,varchar(5)) as tbl from tbl1
union all
select fname + lname+ std_deladr + city+ state+ cast(zip,varchar(5)) as tb1 from tbl2
) tbl1
group by tbl
having count(tbl) > 2