第1个回答 推荐于2016-04-15
用临时表。
查询结果1:
select ...
into #temp1
from ...
where ...
group by ...
order by ...
查询结果2:
select ...
into #temp2
from ...
where ...
group by ...
order by ...
合并:
select #temp1.a,#temp2.b,#temp2.c
from #temp1 inner join #temp2 on #temp1.id=#temp2.id本回答被提问者采纳
第2个回答 2009-02-05
使用内连接查询可以实现;查询结果为横向显示;
select * from 表1 as 别名1 inner join 表2 as 别人2 on(别名1.id=别名2.id)
或者用联合查询;
select * from 表1
unioe
select * from 表2 . 要求表1和表2的字段个数相同.查询结果为纵向显示
第3个回答 2009-02-05
select t1.数字字段名,t1.abc字段名,t2.def字段名 from t1
inner join t2
on t1.数字字段名 = t2.数字字段名
第4个回答 2009-02-06
select t1.数字字段名,t1.abc字段名+t2.def字段名
from t1 ,t2
where t1.数字字段名 = t2.数字字段名
第5个回答 2019-08-23
这是个全外连接的查询
select
A.*
,B.*
from
A
表
A
full
outer
join
B表
B
on
A.aa=B.bb