/****** Script for SelectTopNRows command from SSMS  ******/
SELECT 
      [F_UserCode]
      ,[F_UserName]
      ,[F_DeptId]
      ,[F_RoleId]
      ,[F_Mobile]
      ,[F_WorkNumber]
      ,[F_DeptCode]
  FROM [CallCenter_XinXiangXLX].[dbo].[T_Sys_UserAccount]
  where F_DeptId>20 --and f_username not in (select f_username from AA_UserCount)
  order by F_UserId
  
  select * from AA_UserCount
  where f_username not in (select f_username from T_Sys_UserAccount where F_DeptId>20)
  
  --update T_Sys_UserAccount set F_WorkNumber=(select F_WorkNumber from AA_UserCount where 
  --T_Sys_UserAccount.F_UserCode=AA_UserCount.f_usercode
  --and T_Sys_UserAccount.F_UserName=AA_UserCount.F_UserName
  --and T_Sys_UserAccount.F_RoleId=AA_UserCount.F_RoleId
  --and T_Sys_UserAccount.F_DeptId=AA_UserCount.F_DeptId)