SQL查询结果合并到一个表

selectkeycode,房屋坐落,产权面积,所有权证号,所有权人,Convert(varchar,收件日期,23)fromfilesinwherekeycodein(... select keycode,房屋坐落,产权面积,所有权证号,所有权人,Convert(varchar,收件日期,23) from filesin where keycode in (SELECT keycode FROM zlink WHERE Convert(varchar,gddate,120)between '20130701'and '20130731'and regtype like '%商品%')
select keycode,rvalue,Convert(varchar,gddate,23) from zlink where keycode in (SELECT keycode FROM zlink WHERE Convert(varchar,gddate,120)between '20130701'and '20130731'and regtype like '%商品%')

select keycode,tel from zperson where keycode in (SELECT keycode FROM zlink WHERE Convert(varchar,gddate,120)between '20130701'and '20130731'and regtype like '%商品%')
将这3个查询结果合并到一个表(按keycode字段)里,高手们帮帮忙吧
展开
 我来答
qjitxgd
2013-08-10 · TA获得超过130个赞
知道答主
回答量:101
采纳率:100%
帮助的人:58.9万
展开全部
Select X.*,y.*,z.* From
(select keycode,房屋坐落,产权面积,所有权证号,所有权人,Convert(varchar,收件日期,23) from filesin where keycode in (SELECT keycode FROM zlink WHERE Convert(varchar,gddate,120)between '20130701'and '20130731'and regtype like '%商品%')) X,
(select keycode,rvalue,Convert(varchar,gddate,23) from zlink where keycode in (SELECT keycode FROM zlink WHERE Convert(varchar,gddate,120)between '20130701'and '20130731'and regtype like '%商品%')) Y,
(select keycode,tel from zperson where keycode in (SELECT keycode FROM zlink WHERE Convert(varchar,gddate,120)between '20130701'and '20130731'and regtype like '%商品%') Z
Where X.KeyCode = Y.KeyCode and Y.KeyCode = Z.KeyCode

以上是字段全累加。如不需要可以在第一句中一一标注如:select x.KeyCode,y.rvalue,z.tel From x,y,z ....................................
神龙摆尾而已
2013-08-10
知道答主
回答量:2
采纳率:0%
帮助的人:2.6万
展开全部
23将这3个查询结果合并到一个表(按keycode字段)里,高手们帮帮忙吧
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式