h-you / branches / ddl / 20180629_SQL.txt @ 368
履歴 | 表示 | アノテート | ダウンロード (595 Bytes)
1 |
-- ???R?[?h?????? |
---|---|
2 |
drop table if exists RecordKey cascade; |
3 |
|
4 |
create table RecordKey ( |
5 |
KeyNo decimal(2,0) unsigned not null comment '?L?[?R?[?h' |
6 |
, RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???' |
7 |
|
8 |
, EntryDate datetime not null comment '?o?^???t' |
9 |
, UpdateDate datetime not null comment '?X?V???t' |
10 |
, constraint RecordKey_PKC primary key (KeyNo, RecordNumber) |
11 |
) comment '???R?[?h??????' ; |
12 |
|
13 |
Insert recordkey Value ( |
14 |
1 |
15 |
, ( |
16 |
SELECT |
17 |
IFNULL(MAX(RecordNumber), 0) |
18 |
From |
19 |
messageboarddata |
20 |
) |
21 |
, NOW() |
22 |
, NOW() |
23 |
); |
24 |
commit; |