質問編集履歴
73
規約に反する質問編集であったため、復元しました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
に
|
1
|
+
SQLSEVER 縦の文字列をselect文で横に抽出したい。
|
test
CHANGED
File without changes
|
72
規約に違反する質問編集であったため、復元しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,85 +1,99 @@
|
|
1
|
-
```ここに言
|
1
|
+
```ここに言語を入力
|
2
2
|
|
3
|
-
|
3
|
+
select
|
4
4
|
|
5
|
-
|
5
|
+
ROW_NUMBER()OVER(ORDER BY a.ID) as ID
|
6
6
|
|
7
|
-
|
7
|
+
,姓
|
8
8
|
|
9
|
-
|
9
|
+
,名
|
10
10
|
|
11
|
-
|
11
|
+
,性別
|
12
12
|
|
13
|
-
|
13
|
+
,a.住所+b.住所+c.住所 as 住所
|
14
14
|
|
15
|
-
|
15
|
+
,年齢
|
16
16
|
|
17
|
-
|
17
|
+
,ID2
|
18
18
|
|
19
|
-
|
19
|
+
,趣味
|
20
20
|
|
21
|
-
|
21
|
+
from (select
|
22
22
|
|
23
|
-
|
23
|
+
ID
|
24
24
|
|
25
|
-
|
25
|
+
,姓
|
26
26
|
|
27
|
-
|
27
|
+
,名
|
28
28
|
|
29
|
-
|
29
|
+
,性別
|
30
30
|
|
31
|
-
|
31
|
+
,住所
|
32
32
|
|
33
|
-
|
33
|
+
,年齢
|
34
34
|
|
35
|
-
|
35
|
+
,ID2
|
36
36
|
|
37
|
-
|
37
|
+
,趣味
|
38
38
|
|
39
|
-
|
39
|
+
from K3_Sheet1
|
40
40
|
|
41
|
-
|
41
|
+
where ID2 is not null
|
42
42
|
|
43
|
-
|
43
|
+
) as a
|
44
44
|
|
45
|
-
|
45
|
+
full join
|
46
46
|
|
47
|
-
|
47
|
+
(select
|
48
48
|
|
49
|
-
|
49
|
+
ID
|
50
50
|
|
51
|
-
|
51
|
+
,住所
|
52
52
|
|
53
|
-
|
53
|
+
from K3_Sheet1
|
54
54
|
|
55
|
-
|
55
|
+
where ID2=2 or ID=15
|
56
56
|
|
57
|
-
|
57
|
+
) as b
|
58
58
|
|
59
|
-
|
59
|
+
on a.ID=b.ID-1
|
60
60
|
|
61
|
-
|
61
|
+
full join
|
62
62
|
|
63
|
-
|
63
|
+
(select
|
64
64
|
|
65
|
-
|
65
|
+
ID
|
66
66
|
|
67
|
-
|
67
|
+
,住所
|
68
68
|
|
69
|
-
|
69
|
+
from K3_Sheet1
|
70
70
|
|
71
|
-
|
71
|
+
where ID2=3 or ID=12 or ID=16
|
72
72
|
|
73
|
-
|
73
|
+
) as c
|
74
74
|
|
75
|
-
|
75
|
+
on a.ID=c.ID-2
|
76
76
|
|
77
|
-
```
|
77
|
+
```### 前提・実現したいこと
|
78
78
|
|
79
|
-
|
79
|
+
sqlserverで
|
80
80
|
|
81
|
-
|
81
|
+
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
82
82
|
|
83
|
-
|
83
|
+
### このExcelの表を
|
84
84
|
|
85
|
+
![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
|
86
|
+
|
87
|
+
### 下の図のように出力したい
|
88
|
+
|
89
|
+
![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
|
90
|
+
|
85
|
-
|
91
|
+
### 試したこと
|
92
|
+
|
93
|
+
データがふえた場合でも同じように結果を出したいです。
|
94
|
+
|
95
|
+
どなたかよろしくお願いします。
|
96
|
+
|
97
|
+
### 補足情報(FW/ツールのバージョンなど)
|
98
|
+
|
99
|
+
SQLserver を使用しています。
|
71
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
70
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
69
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
68
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
67
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
66
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
65
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
64
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
63
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
62
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
61
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
60
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
59
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
58
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
57
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
56
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
55
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
54
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
53
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
52
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
51
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
50
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
49
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
48
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
47
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
46
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
45
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
44
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
43
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
42
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
41
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
40
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
39
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
38
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
37
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
36
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
35
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
34
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
33
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
32
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
31
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
30
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
29
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
28
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
27
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
26
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
25
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
24
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
23
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
22
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
21
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
20
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
19
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
18
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
17
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
16
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
15
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
14
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
13
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
12
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
11
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
10
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
9
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
8
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
7
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
6
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
にかさはややなかはらい。
|
test
CHANGED
@@ -1,117 +1,85 @@
|
|
1
|
-
```ここに言語を入力
|
1
|
+
```ここに言```````````````````````````````````````````````````````````````ここに言語を入力
|
2
2
|
|
3
|
-
|
3
|
+
ここに言語を入力
|
4
4
|
|
5
|
-
|
5
|
+
```
|
6
6
|
|
7
|
-
|
7
|
+
ここに言語を入力
|
8
8
|
|
9
|
-
|
9
|
+
```
|
10
10
|
|
11
|
-
|
11
|
+
ここに言語を入力
|
12
12
|
|
13
|
-
|
13
|
+
```
|
14
14
|
|
15
|
-
|
15
|
+
ここに言語を入力
|
16
16
|
|
17
|
-
|
17
|
+
```
|
18
18
|
|
19
|
-
|
19
|
+
ここに言語を入力
|
20
20
|
|
21
|
-
|
21
|
+
```
|
22
22
|
|
23
|
-
|
23
|
+
ここに言語を入力
|
24
24
|
|
25
|
-
|
25
|
+
```
|
26
26
|
|
27
|
-
|
27
|
+
ここに言語を入力
|
28
28
|
|
29
|
-
|
29
|
+
```
|
30
30
|
|
31
|
-
|
31
|
+
ここに言語を入力
|
32
32
|
|
33
|
-
|
33
|
+
```
|
34
34
|
|
35
|
-
|
35
|
+
ここに言語を入力
|
36
36
|
|
37
|
-
|
37
|
+
```
|
38
38
|
|
39
|
-
|
39
|
+
ここに言語を入力
|
40
40
|
|
41
|
-
|
41
|
+
```
|
42
42
|
|
43
|
-
|
43
|
+
ここに言語を入力
|
44
44
|
|
45
|
-
|
45
|
+
```
|
46
46
|
|
47
|
-
|
47
|
+
ここに言語を入力
|
48
48
|
|
49
|
-
|
49
|
+
```
|
50
50
|
|
51
|
-
|
51
|
+
ここに言語を入力
|
52
52
|
|
53
|
-
|
53
|
+
```
|
54
54
|
|
55
|
-
|
55
|
+
ここに言語を入力
|
56
56
|
|
57
|
-
|
57
|
+
```
|
58
58
|
|
59
|
-
|
59
|
+
ここに言語を入力
|
60
60
|
|
61
|
-
|
61
|
+
```
|
62
62
|
|
63
|
-
|
63
|
+
ここに言語を入力
|
64
64
|
|
65
|
-
|
65
|
+
```
|
66
66
|
|
67
|
-
|
67
|
+
ここに言語を入力
|
68
68
|
|
69
|
-
|
69
|
+
```
|
70
70
|
|
71
|
-
|
71
|
+
ここに言語を入力
|
72
72
|
|
73
|
-
|
73
|
+
```
|
74
74
|
|
75
|
-
|
75
|
+
ここに言語を入力
|
76
76
|
|
77
|
-
```
|
77
|
+
```
|
78
78
|
|
79
|
-
|
79
|
+
ここに言語を入力
|
80
80
|
|
81
|
-
|
81
|
+
```
|
82
82
|
|
83
|
+
コード
|
83
84
|
|
84
|
-
|
85
|
-
### このExcelの表を
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
### 下の図のように出力したい
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
85
|
+
```
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
データがふえた場合でも同じように結果を出したいです。
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
どなたかよろしくお願いします。
|
114
|
-
|
115
|
-
### 補足情報(FW/ツールのバージョンなど)
|
116
|
-
|
117
|
-
SQLserver を使用しています。
|
5
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -106,9 +106,9 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
-
|
109
|
+
データがふえた場合でも同じように結果を出したいです。
|
110
110
|
|
111
|
-
|
111
|
+
|
112
112
|
|
113
113
|
どなたかよろしくお願いします。
|
114
114
|
|
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,32 +1,4 @@
|
|
1
|
-
### 前提・実現したいこと
|
2
|
-
|
3
|
-
sqlserverで
|
4
|
-
|
5
|
-
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
```ここに言語を入力
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
### 下の図のように出力したい
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
### 試したこと
|
28
|
-
|
29
|
-
|
30
2
|
|
31
3
|
select
|
32
4
|
|
@@ -102,6 +74,38 @@
|
|
102
74
|
|
103
75
|
on a.ID=c.ID-2
|
104
76
|
|
77
|
+
```### 前提・実現したいこと
|
78
|
+
|
79
|
+
sqlserverで
|
80
|
+
|
81
|
+
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
### このExcelの表を
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
### 下の図のように出力したい
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
### 試したこと
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
105
109
|
この書き方だとデータがふえると手間になります。
|
106
110
|
|
107
111
|
たぶん規則性があるんでしょうけど
|
2
修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
SQLSEVER 縦の文字列をselect文で横に抽出したい。
|
test
CHANGED
File without changes
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
|
3
|
+
sqlserverで
|
4
4
|
|
5
5
|
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
6
6
|
|
@@ -10,11 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
```
|
14
|
-
|
15
|
-
[イメージ説明](
|
13
|
+
![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
|
16
|
-
|
17
|
-
```
|
18
14
|
|
19
15
|
|
20
16
|
|