例如
1
select a from table12 
select b,c from table 2
======================
最终显示结果 
a b c
2 3  4
2 3  4
2 3  4
thanks

解决方案 »

  1.   


    select a.a,b.b,b.c
    from table 1 a,table2 b
      

  2.   


    select a.a,b.b,b.c
    from table1 a,table2 b
      

  3.   

    两个表有关联吗
    如果有
    select tb1.a,tb2.b,tb2.c from tb1 join tb2 on tb1.关联字段=tb2.关联字段
      

  4.   

    select a from table1
    outer apply(select b,c from table2) n
      

  5.   

    select
       a.a,b.b,b.c
    from
      (select id=row_number()over(order by getdate()),* from tb1)a,
      (select id=row_number()over(order by getdate()),* from tb2)b
    where
       a.id=b.id
      

  6.   

    设置id关联,
    或者使用row_number,
    或者使用下面的临时表
    select *,identity(int,1,1) as id into #1 from tb1
    select *,identity(int,1,1) as id into #2 from tb2
    select a,b,c from #1 a,#2 b where a.id=b.id