select id,username into #A from users where '查询条件' --此句为取出users 表中username字段 select id,userEmail into #B from userInfo where '查询条件' --此句为取出userInfo表中相关字段select #B.id,#A.username,#B.userEmail from #A inner join #B on #A.id=#B.id --此句为将users表中字段username插入userInfo表中其中users表和userInfo表中需要有相关联的字段(此例中为id)
select id,username into #A from users where '查询条件' --此句为取出users 表中username字段
select id,userEmail into #B from userInfo where '查询条件' --此句为取出userInfo表中相关字段select #B.id,#A.username,#B.userEmail from #A inner join #B on #A.id=#B.id --此句为将users表中字段username插入userInfo表中其中users表和userInfo表中需要有相关联的字段(此例中为id)