如题,我想把按某个条件检索出的结果,保存成一个新表,有这样的SQL语句吗?

解决方案 »

  1.   


    Select *  into 新表  from tb
    where  ....
      

  2.   

    INSERT TABLE2 SELECT * FROM TB WHERE .....
      

  3.   


    一种方式:
       SELECT .....INTO 新表 FROM LI .......另外一种方式:
      CREATE TABLE TLI (ID INT,.......)
      INSERT TLI (ID,......)
      SELECT ID,..........
      FROM LI 
      

  4.   

    select * into table2 from table1
    要看字段,如果有其它值建立字段,比如下面的语句就先建表比较好,因为这个字段这样可以保证类型.
    select *,'t2' col2 into table2 from table1
      

  5.   

    Select *  into 新表  from tb
    where  ....
      

  6.   

    select * from into 新 from tb
      

  7.   

    create table @table
    (
      字段,
      字段
    )
    inert @table select字段 from table2 where 条件
      

  8.   

    select *  into #table from  table where .....
      

  9.   

    SELECT .....INTO 新表 FROM LI .......