質問編集履歴
73
規約に反する質問編集であったため、復元しました。
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
に
|
1
|
+
SQLSEVER 縦の文字列をselect文で横に抽出したい。
|
body
CHANGED
File without changes
|
72
規約に違反する質問編集であったため、復元しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,43 +1,50 @@
|
|
1
|
-
```ここに言```````````````````````````````````````````````````````````````ここに言語を入力
|
2
|
-
ここに言語を入力
|
1
|
+
```ここに言語を入力
|
2
|
+
select
|
3
|
+
ROW_NUMBER()OVER(ORDER BY a.ID) as ID
|
4
|
+
,姓
|
5
|
+
,名
|
3
|
-
|
6
|
+
,性別
|
4
|
-
|
7
|
+
,a.住所+b.住所+c.住所 as 住所
|
5
|
-
|
8
|
+
,年齢
|
6
|
-
|
9
|
+
,ID2
|
7
|
-
|
10
|
+
,趣味
|
8
|
-
|
11
|
+
from (select
|
12
|
+
ID
|
13
|
+
,姓
|
14
|
+
,名
|
9
|
-
|
15
|
+
,性別
|
10
|
-
ここに言語を入力
|
11
|
-
|
16
|
+
,住所
|
12
|
-
ここに言語を入力
|
13
|
-
|
17
|
+
,年齢
|
14
|
-
|
18
|
+
,ID2
|
15
|
-
|
19
|
+
,趣味
|
20
|
+
from K3_Sheet1
|
21
|
+
where ID2 is not null
|
22
|
+
) as a
|
16
|
-
|
23
|
+
full join
|
24
|
+
(select
|
25
|
+
ID
|
17
|
-
|
26
|
+
,住所
|
27
|
+
from K3_Sheet1
|
28
|
+
where ID2=2 or ID=15
|
29
|
+
) as b
|
30
|
+
on a.ID=b.ID-1
|
18
|
-
|
31
|
+
full join
|
32
|
+
(select
|
33
|
+
ID
|
19
|
-
|
34
|
+
,住所
|
35
|
+
from K3_Sheet1
|
36
|
+
where ID2=3 or ID=12 or ID=16
|
37
|
+
) as c
|
38
|
+
on a.ID=c.ID-2
|
39
|
+
```### 前提・実現したいこと
|
40
|
+
sqlserverで
|
41
|
+
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
42
|
+
### このExcelの表を
|
43
|
+

|
44
|
+
### 下の図のように出力したい
|
45
|
+

|
20
|
-
こ
|
46
|
+
### 試したこと
|
21
|
-
|
47
|
+
データがふえた場合でも同じように結果を出したいです。
|
22
|
-
|
48
|
+
どなたかよろしくお願いします。
|
23
|
-
|
49
|
+
### 補足情報(FW/ツールのバージョンなど)
|
24
|
-
|
50
|
+
SQLserver を使用しています。
|
25
|
-
```
|
26
|
-
ここに言語を入力
|
27
|
-
```
|
28
|
-
ここに言語を入力
|
29
|
-
```
|
30
|
-
ここに言語を入力
|
31
|
-
```
|
32
|
-
ここに言語を入力
|
33
|
-
```
|
34
|
-
ここに言語を入力
|
35
|
-
```
|
36
|
-
ここに言語を入力
|
37
|
-
```
|
38
|
-
ここに言語を入力
|
39
|
-
```
|
40
|
-
ここに言語を入力
|
41
|
-
```
|
42
|
-
コード
|
43
|
-
```
|
71
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
70
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
69
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
68
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
67
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
66
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
65
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
64
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
63
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
62
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
61
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
60
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
59
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
58
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
57
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
56
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
55
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
54
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
53
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
52
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
51
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
50
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
49
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
48
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
47
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
46
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
45
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
44
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
43
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
42
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
41
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
40
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
39
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
38
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
37
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
36
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
35
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
34
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
33
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
32
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
31
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
30
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
29
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
28
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
27
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
26
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
25
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
24
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
23
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
22
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
21
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
20
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
19
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
18
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
17
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
16
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
15
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
14
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
13
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
12
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
11
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
10
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
9
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
8
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
7
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
6
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
にかさはややなかはらい。
|
body
CHANGED
@@ -1,59 +1,43 @@
|
|
1
|
-
```ここに言語を入力
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
```
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-

|
46
|
-
|
47
|
-
### 下の図のように出力したい
|
48
|
-
|
49
|
-

|
50
|
-
|
51
|
-
|
52
|
-
### 試したこと
|
53
|
-
|
54
|
-
|
55
|
-
データがふえた場合でも同じように結果を出したいです。
|
56
|
-
|
57
|
-
どなたかよろしくお願いします。
|
58
|
-
### 補足情報(FW/ツールのバージョンなど)
|
59
|
-
SQLserver を使用しています。
|
1
|
+
```ここに言```````````````````````````````````````````````````````````````ここに言語を入力
|
2
|
+
ここに言語を入力
|
3
|
+
```
|
4
|
+
ここに言語を入力
|
5
|
+
```
|
6
|
+
ここに言語を入力
|
7
|
+
```
|
8
|
+
ここに言語を入力
|
9
|
+
```
|
10
|
+
ここに言語を入力
|
11
|
+
```
|
12
|
+
ここに言語を入力
|
13
|
+
```
|
14
|
+
ここに言語を入力
|
15
|
+
```
|
16
|
+
ここに言語を入力
|
17
|
+
```
|
18
|
+
ここに言語を入力
|
19
|
+
```
|
20
|
+
ここに言語を入力
|
21
|
+
```
|
22
|
+
ここに言語を入力
|
23
|
+
```
|
24
|
+
ここに言語を入力
|
25
|
+
```
|
26
|
+
ここに言語を入力
|
27
|
+
```
|
28
|
+
ここに言語を入力
|
29
|
+
```
|
30
|
+
ここに言語を入力
|
31
|
+
```
|
32
|
+
ここに言語を入力
|
33
|
+
```
|
34
|
+
ここに言語を入力
|
35
|
+
```
|
36
|
+
ここに言語を入力
|
37
|
+
```
|
38
|
+
ここに言語を入力
|
39
|
+
```
|
40
|
+
ここに言語を入力
|
41
|
+
```
|
42
|
+
コード
|
43
|
+
```
|
5
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
4
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -52,8 +52,8 @@
|
|
52
52
|
### 試したこと
|
53
53
|
|
54
54
|
|
55
|
-
|
55
|
+
データがふえた場合でも同じように結果を出したいです。
|
56
|
-
|
56
|
+
|
57
57
|
どなたかよろしくお願いします。
|
58
58
|
### 補足情報(FW/ツールのバージョンなど)
|
59
59
|
SQLserver を使用しています。
|
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,18 +1,4 @@
|
|
1
|
-
### 前提・実現したいこと
|
2
|
-
sqlserverで
|
3
|
-
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
4
|
-
|
5
|
-
|
1
|
+
```ここに言語を入力
|
6
|
-
|
7
|
-

|
8
|
-
|
9
|
-
### 下の図のように出力したい
|
10
|
-
|
11
|
-

|
12
|
-
|
13
|
-
|
14
|
-
### 試したこと
|
15
|
-
|
16
2
|
select
|
17
3
|
ROW_NUMBER()OVER(ORDER BY a.ID) as ID
|
18
4
|
,姓
|
@@ -50,6 +36,22 @@
|
|
50
36
|
where ID2=3 or ID=12 or ID=16
|
51
37
|
) as c
|
52
38
|
on a.ID=c.ID-2
|
39
|
+
```### 前提・実現したいこと
|
40
|
+
sqlserverで
|
41
|
+
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
42
|
+
|
43
|
+
### このExcelの表を
|
44
|
+
|
45
|
+

|
46
|
+
|
47
|
+
### 下の図のように出力したい
|
48
|
+
|
49
|
+

|
50
|
+
|
51
|
+
|
52
|
+
### 試したこと
|
53
|
+
|
54
|
+
|
53
55
|
この書き方だとデータがふえると手間になります。
|
54
56
|
たぶん規則性があるんでしょうけど
|
55
57
|
どなたかよろしくお願いします。
|
2
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
SQLSEVER 縦の文字列をselect文で横に抽出したい。
|
body
CHANGED
File without changes
|
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
|
-
|
2
|
+
sqlserverで
|
3
3
|
後でデータを追加しても二つ目の図のように表示できるようにしたいです。
|
4
4
|
|
5
5
|
### このExcelの表を
|
6
6
|
|
7
|
-
```
|
8
|
-
[イメージ説明](
|
7
|
+

|
9
|
-
```
|
10
8
|
|
11
9
|
### 下の図のように出力したい
|
12
10
|
|