解决方案 »

  1.   

    --只要你的内容列能对上
    select * INTO #T from SysBill a,VersionModel b where a.ModelId=b.IDINSERT INTO #T
    select * from SysBill where ModelId is Null
      

  2.   


    IF OBJECT_ID('#T')IS NOT NULL
    DROP TABLE #T
    GO
    select a.* INTO #T from SysBill a,VersionModel b where a.ModelId=b.ID
     
    INSERT INTO #T
    select * from SysBill where ModelId is Null
      

  3.   

    SQL Server没有虚拟表的概念, LZ可以考虑用临时表,表变量或视图.
      

  4.   

    何必分成两句,等价的查询不就是
    select *
      from SysBill a
     where ModelId is Null
        OR EXISTS (SELECT *
                     FROM VersionModel b
                    where a.ModelId=b.ID
                  )
      

  5.   

    新手用select * into #B from table 好理解些