アウトプットができる技術者に

it's a time to take a new step !

Sybase ASE 入門 テーブルの作成 select into statement

テーブルを作成するには、create table の他、select into でもOK

  • 作成元にしたテーブルのカラム制約が、新しいテーブルに引き継がれる。
  • ただし、IndexやPrimaryKey制約は 引き継がれない。
select * into test_table2 from test_table1

-- sample
select * from test_table1
 id         name       age         
 ---------- ---------- ----------- 
 1          name1               10 
 11         name11              11 


select * into test_table2 from test_table1
(2 rows affected)

select * from test_table2
 id         name       age         
 ---------- ---------- ----------- 
 1          name1               10 
 11         name11              11 
一時テーブル

テーブル名に#をつけると、一時テーブルになるらしいので、検証予定。
select into #test_table


Sybase ASE 入門 目次