LoginSignup
2
0

More than 1 year has passed since last update.

CTAS(Create Table As Select)他テーブルを利用したテーブルの作成方法

Posted at

目的

TeradataにおけるCTAS(Create Table As Select)他テーブルを利用したテーブルの作成方法

コマンド

内容 コマンド 実行例・補足
他テーブルを利用したテーブル作成 Create table [テーブル名] as (select * from [元テーブル名]) with data;

実行例

create table t2 as (select * from t1) with data;

 *** Table has been created. 
 *** Total elapsed time was 54 seconds.


 BTEQ -- Enter your SQL request or BTEQ command: 
select count(*) from t1;

select count(*) from t1;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

   Count(*)
-----------
   16777216

 BTEQ -- Enter your SQL request or BTEQ command: 
select count(*) from t2;

select count(*) from t2;

 *** Query completed. One row found. One column returned. 
 *** Total elapsed time was 1 second.

   Count(*)
-----------
   16777216


参考

Using Teradata SQL: Create a table from another table or select statement

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0