问个简单问题:怎样累计两个表中相同字段的数值?
有2个表,结构完全相同,例如:Id,Name,Age 
 求: 
 1、两个表中共有的数据条数 
 2、两个表中所有数据的Age字段的总和   
 请教Sql语句该怎样写?
------解决方案--------------------1. 
 select count(1)  
 from 
 (select * from Table1 
 union all  
 select * from table2) T   
 2. 
 select sum(age)  
 from 
 (select * from Table1 
 union all  
 select * from table2) T
------解决方案--------------------用Union All 就行了 
 ---------------------------- 
 1. 
 select  
      count(*) As  '两个表共有的条数 ' 
 from ( 
     select * from 第1个表 
     union all  
     select * from 第2个表 
      ) T 
 2. 
 select  
      sum(age) As  '总和 ' 
 from ( 
      select * from 第1个表 
      union all  
      select * from 第2个表 
      ) T
------解决方案--------------------有2个表,结构完全相同,例如:Id,Name,Age 
 求: 
 1、两个表中共有的数据条数   
 select count(1) from table1 a,table2 b where a.id=b.id and a.name=b.name and a.age=b.age 
 2、两个表中所有数据的Age字段的总和   
 select sum(age) from table1  
 select sum(age) from table2