teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

4

文法の修正

2016/01/15 05:48

投稿

a_m
a_m

スコア10

answer CHANGED
@@ -32,10 +32,5 @@
32
32
  ・・・
33
33
  select 10 as creator
34
34
  ) d
35
- order by
36
- a.id_number,
37
- b.status,
38
- c.create_add,
39
- d.creator
40
35
  ;
41
36
  ```

3

文法の修正

2016/01/15 05:48

投稿

a_m
a_m

スコア10

answer CHANGED
@@ -18,7 +18,7 @@
18
18
  select 1 as status union all
19
19
  select 2 as status union all
20
20
  ・・・
21
- select as 20 status
21
+ select 20 as status
22
22
  ) b
23
23
  cross join (
24
24
  select 1 as create_add union all

2

書式の改善

2016/01/15 04:06

投稿

a_m
a_m

スコア10

answer CHANGED
@@ -8,29 +8,29 @@
8
8
  c.create_add,
9
9
  d.creator
10
10
  from (
11
- select 1 id_number union all
11
+ select 1 as id_number union all
12
- select 2 id_number union all
12
+ select 2 as id_number union all
13
- select 3 id_number union all
13
+ select 3 as id_number union all
14
14
  ・・・
15
- select 25 id_number
15
+ select 25 as id_number
16
16
  ) a
17
17
  cross join (
18
- select 1 status union all
18
+ select 1 as status union all
19
- select 2 status union all
19
+ select 2 as status union all
20
20
  ・・・
21
- select 20 status
21
+ select as 20 status
22
22
  ) b
23
23
  cross join (
24
- select 1 create_add union all
24
+ select 1 as create_add union all
25
- select 2 create_add union all
25
+ select 2 as create_add union all
26
26
  ・・・
27
- select 20 create_add
27
+ select 20 as create_add
28
28
  ) c
29
29
  cross join (
30
- select 1 creator union all
30
+ select 1 as creator union all
31
- select 2 creator union all
31
+ select 2 as creator union all
32
32
  ・・・
33
- select 10 creator
33
+ select 10 as creator
34
34
  ) d
35
35
  order by
36
36
  a.id_number,

1

誤字の修正

2016/01/15 03:50

投稿

a_m
a_m

スコア10

answer CHANGED
@@ -1,5 +1,5 @@
1
1
  idがPKの場合、下記の形はいかがでしょうか。
2
- それぞれのカラム分の疑似テーブルを作成し、cross joinしたデータ(25☓20☓20☓10=100,000件)の結果をInsertしています。
2
+ それぞれのカラム分の疑似テーブルを作成し、cross joinした結果(25☓20☓20☓10=100,000件)をInsertしています。
3
3
  ```SQL
4
4
  insert into sample(id_number,status,create_add,creator)
5
5
  select