SQL查询结果合并到一个表
发布网友
发布时间:2022-04-13 13:52
我来回答
共3个回答
懂视网
时间:2022-04-13 18:14
union all union all
union all
union all
,
热心网友
时间:2022-04-13 15:22
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 ....................................
热心网友
时间:2022-04-13 16:40
23将这3个查询结果合并到一个表(按keycode字段)里,高手们帮帮忙吧