select * from table1
union
select * from table2

解决方案 »

  1.   

    select * from table1
    union all
    select * from table2
      

  2.   

    select * from table1
    union all
    select * from table2
      

  3.   

    你们有没有在SQL 2000下试过,ntext格式的文件不能用union的!
    不过也谢谢,你们的答案!
      

  4.   

    insert table1 select * from table2不行吗? 
    或建立一个新表将另一个表的内容插入
    select * into newtable from table1
    insert newtable select * from table2
    或用union
      

  5.   

    union不行的,我也不想建新表~
      

  6.   

    那就只有通过建临时表的方法了吧!
    将从两个表查询出来的符合条件的记录插入到临时表中!
    从临时表中反回结果集,再drop table 
    祝你好运
      

  7.   

    你们有没有在SQL 2000下试过,ntext格式的文件不能用union的!??
    有这种事?我要去测试一下
      

  8.   

    不知道如下,是否符合你的意思,里面肯定会存在重复项的
    --测试
    create table tb1(a ntext)
    insert tb1 values('12345')
    create table tb2(a ntext)
    insert tb2 values('56789')select a from tb1
    union all
    select a from tb2drop table tb1,tb2--结果
    a
    -----------------------------                                                                                 12345
    56789(所影响的行数为 2 行)
      

  9.   

    create table tb1(a ntext)
    create table t(a ntext)
    insert tb1 values('12345')
    create table tb2(a ntext)
    insert tb2 values('56789')insert into t
    select * from tb2insert into t
    select * from tb1
      

  10.   

    select * from table1 union all  select * from table2
    也不行吗?应该可以的。