h-you / branches / ddl / 20171003_SQL.txt @ 362
履歴 | 表示 | アノテート | ダウンロード (1.12 KB)
| 1 | -- ?H???????? | 
|---|---|
| 2 | DROP TABLE IF EXISTS constructionmaterialinfo_OLD; | 
| 3 | CREATE TABLE constructionmaterialinfo_OLD As Select * from constructionmaterialinfo ; | 
| 4 |  | 
| 5 | drop table if exists constructionmaterialinfo cascade; | 
| 6 |  | 
| 7 | create table constructionmaterialinfo ( | 
| 8 | CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????' | 
| 9 | , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h' | 
| 10 | , PROCESSDATE datetime comment '?????N????' | 
| 11 | , RENTCOUNT smallint(5) unsigned comment '??o??' | 
| 12 | , REPAYCOUNT smallint(5) unsigned comment '??p??' | 
| 13 | , JUNKCOUNT smallint(5) unsigned comment '?j????' | 
| 14 | , COMPLETEFLG tinyint(3) unsigned comment '?????t???O' | 
| 15 | , ENTRYDATE datetime comment '?o?^???t' | 
| 16 | , UPDATEDATE datetime comment '?X?V???t' | 
| 17 | , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE) | 
| 18 | ) comment '?H????????' ; | 
| 19 |  | 
| 20 | Insert INTO constructionmaterialinfo | 
| 21 | SELECT | 
| 22 | CONSTRUCTIONCODE | 
| 23 | , MATERIALITEMCODE | 
| 24 | , DATE(ENTRYDATE) | 
| 25 | , RENTCOUNT | 
| 26 | , REPAYCOUNT | 
| 27 | , 0 | 
| 28 | , COMPLETEFLG | 
| 29 | , ENTRYDATE | 
| 30 | , UPDATEDATE | 
| 31 | FROM constructionmaterialinfo_OLD | 
| 32 | ; | 
| 33 | commit; |