带关系的两个表横向拼凑怎么做啊
表A
select * from a
得到下图
表B
select * from b
得到下图
如果select * from a left join b on a.uid = b.uid
则
我想要的结果如下
用join的话 ,有些行并不需要,我只是想拼起来就行,不用那个笛卡尔积,这个问题怎么解决啊,在线等,。,。。。
[解决办法]
select * from(select row_number()over(partition by UID order by getdate()) as row,* from a)tfull join (select row_number()over(partition by UID order by getdate()) as row,* from b)mon a.row=b.row
[解决办法]