質問編集履歴

3

スペルミスの修正

2018/11/19 13:06

投稿

_silver
_silver

スコア13

test CHANGED
File without changes
test CHANGED
@@ -134,11 +134,11 @@
134
134
 
135
135
  u.user_name,
136
136
 
137
- s.shouhin_id,
137
+ s.shohin_id,
138
138
 
139
- s.shouhin_name,
139
+ s.shohin_name,
140
140
 
141
- LISTAGG(s.shouhin_id, ',') WITHIN GROUP (ORDER by null) nm
141
+ LISTAGG(s.shohin_id, ',') WITHIN GROUP (ORDER by null) nm
142
142
 
143
143
  FROM
144
144
 
@@ -148,7 +148,7 @@
148
148
 
149
149
  WHERE u.ID = s.shohin_id
150
150
 
151
- group by s.shouhin_name
151
+ group by s.shohin_name
152
152
 
153
153
  ";
154
154
 

2

スペルミスの修正

2018/11/19 13:06

投稿

_silver
_silver

スコア13

test CHANGED
File without changes
test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  商品テーブル
24
24
 
25
- |key|shohin_id|syohin_name|
25
+ |key|shohin_id|shohin_name|
26
26
 
27
27
  |:--:|:--:|:--:|
28
28
 

1

見やすく修正しました

2018/11/19 13:05

投稿

_silver
_silver

スコア13

test CHANGED
File without changes
test CHANGED
@@ -8,31 +8,33 @@
8
8
 
9
9
  userテーブル
10
10
 
11
- | ID | name |
11
+ |id|name|
12
12
 
13
- | 1 | AAA |
13
+ |:--:|:--:|
14
14
 
15
- | 2 | BBB |
15
+ |1|AAA|
16
16
 
17
+ |2|BBB|
18
+
17
- | 3 | CCC |
19
+ |3|CCC|
18
20
 
19
21
 
20
22
 
21
23
  商品テーブル
22
24
 
25
+ |key|shohin_id|syohin_name|
23
26
 
27
+ |:--:|:--:|:--:|
24
28
 
25
- | key | shohin_id | syohin_name |
29
+ |1|1|ああ|
26
30
 
27
- | 1 | 1 | ああ |
31
+ |2|1|いい|
28
32
 
29
- | 2 | 1 | いい |
33
+ |3|2|うう|
30
34
 
31
- | 3 | 2 | うう |
35
+ |4|3|ええ|
32
36
 
33
- | 4 | 3 | ええ |
34
-
35
- | 5 | 4 | おお |
37
+ |5|4|おお|
36
38
 
37
39
 
38
40
 
@@ -40,27 +42,31 @@
40
42
 
41
43
  とするとGetAllで
42
44
 
43
-
45
+ ```ここに言語を入力
44
46
 
45
47
  0=>{
46
48
 
47
- name => AAA
49
+ name => AAA
48
50
 
49
- shohin_id => 1
51
+ shohin_id => 1
50
52
 
51
- shohin_name => ああ
53
+ shohin_name => ああ
52
54
 
53
55
  }
54
56
 
55
57
  1=>{
56
58
 
57
- name => AAA
59
+ name => AAA
58
60
 
59
- shohin_id => 1
61
+ shohin_id => 1
60
62
 
61
- shohin_name => いい
63
+ shohin_name => いい
62
64
 
63
65
  }
66
+
67
+ ```
68
+
69
+
64
70
 
65
71
 
66
72
 
@@ -68,27 +74,35 @@
68
74
 
69
75
 
70
76
 
71
- | ID | name |shohin_id | shohin_name |
77
+ |ID|name|shohin_id|shohin_name|
72
78
 
73
- | 1 | AAA | 1   | ああ,いい |
79
+ |:--:|:--:|:--:|:--:|
74
80
 
75
- | 2 | BBB | 2 | いい |
81
+ |1|AAA|1|ああ,いい|
76
82
 
83
+ |2|BBB|2|いい|
84
+
77
- | 3 | CCC | 3 | ええ |
85
+ |3|CCC|3|ええ|
78
86
 
79
87
 
80
88
 
81
89
  配列だと
82
90
 
91
+ ```ここに言語を入力
92
+
83
93
  {
84
94
 
85
- name => AAA
95
+ name => AAA
86
96
 
87
- shohin_id => 1
97
+ shohin_id => 1
88
98
 
89
- shohin_name => {0=>ああ,1=>いい}
99
+ shohin_name => {0=>ああ,1=>いい}
90
100
 
91
101
  }
102
+
103
+ ```
104
+
105
+
92
106
 
93
107
  こんな感じにしたいです。
94
108
 
@@ -110,35 +124,41 @@
110
124
 
111
125
 
112
126
 
127
+ ```ここに言語を入力
128
+
113
129
  $sql ="
114
130
 
115
- SELECT
131
+ SELECT
116
132
 
117
- u.user_id,
133
+ u.user_id,
118
134
 
119
- u.user_name,
135
+ u.user_name,
120
136
 
121
- s.shouhin_id,
137
+ s.shouhin_id,
122
138
 
123
- s.shouhin_name,
139
+ s.shouhin_name,
124
140
 
125
- LISTAGG(s.shouhin_id, ',') WITHIN GROUP (ORDER by null) nm
141
+ LISTAGG(s.shouhin_id, ',') WITHIN GROUP (ORDER by null) nm
126
142
 
127
- FROM
143
+ FROM
128
144
 
129
- USER u
145
+ USER u
130
146
 
131
- SHOUHIN s
147
+ SHOUHIN s
132
148
 
133
- WHERE u.ID = s.shohin_id
149
+ WHERE u.ID = s.shohin_id
134
150
 
135
- group by s.shouhin_name
151
+ group by s.shouhin_name
136
152
 
137
153
  ";
138
154
 
139
155
 
140
156
 
141
157
  $db->GetAll($sql);
158
+
159
+ ```
160
+
161
+
142
162
 
143
163
 
144
164