如何实现两表横向联合,缺少处补“0”
有两表   A,   B记录各用户使用时间,UsedTime为总共用时(包括空闲和活动用时) 
 ActiveTime为活动用时   
 A: 
 UserID            UsedTime 
 1001                  10 
 1002                  15 
 1003                  16   
 B: 
 UserID            ActiveTime 
 1001                  5 
 1003                  10   
 要将两表联合 
 UserID            UsedTime               ActiveTime 
 1001                  10                                 5 
 1002                  15                                 0 
 1003                  16                                 10   
 请教如何实现,   谢谢!
------解决方案--------------------select A.UserID, B.UsedTime, isnull(ActiveTime,0) as ActiveTime 
 from A 
      left join B on A.UserID = B.A.UserID