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

質問編集履歴

73

規約に反する質問編集であったため、復元しました。

2020/04/02 01:53

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- かさはややなかはらい。
1
+ SQLSEVER 縦の文字列をselect文で横抽出したい。
body CHANGED
File without changes

72

規約に違反する質問編集であったため、復元しました。

2020/04/02 01:53

投稿

退会済みユーザー
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
+ ![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
44
+ ### 下の図のように出力したい
45
+ ![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
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

2020/04/02 01:51

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

70

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

69

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

68

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

67

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

66

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

65

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

64

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

63

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

62

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

61

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

60

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

59

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

58

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

57

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

56

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

55

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

54

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

53

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

52

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

51

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

50

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

49

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

48

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

47

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

46

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

45

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

44

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

43

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

42

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

41

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

40

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

39

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

38

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

37

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

36

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

35

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

34

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

33

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

32

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

31

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

30

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

29

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

28

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

27

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

26

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

25

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

24

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

23

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

22

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

21

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

20

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

19

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

18

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

17

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

16

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

15

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

14

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

13

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

12

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

11

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

10

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

9

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

8

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

7

2020/04/01 08:48

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

6

2020/04/01 08:47

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- SQLSEVER 縦の文字列をselect文で横抽出したい。
1
+ かさはややなかはらい。
body CHANGED
@@ -1,59 +1,43 @@
1
- ```ここに言語を入力
2
- select
3
- ROW_NUMBER()OVER(ORDER BY a.ID) as ID
4
- ,姓
5
- ,名
6
- ,性別
7
- ,a.住所+b.住所+c.住所 as 住所
8
- ,年齢
9
- ,ID2
10
- ,趣味
11
- from (select
12
- ID
13
- ,姓
14
- ,名
15
- ,性別
16
- ,住所
17
- ,年齢
18
- ,ID2
19
- ,趣味
20
- from K3_Sheet1
21
- where ID2 is not null
22
- ) as a
23
- full join
24
- (select
25
- ID
26
- ,住所
27
- from K3_Sheet1
28
- where ID2=2 or ID=15
29
- ) as b
30
- on a.ID=b.ID-1
31
- full join
32
- (select
33
- ID
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
-
43
- ### このExcelの表を
44
-
45
- ![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
46
-
47
- ### 下の図のように出力したい
48
-
49
- ![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
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

2020/04/01 08:47

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes

4

修正

2020/04/01 08:47

投稿

退会済みユーザー
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

修正

2020/03/26 02:15

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,18 +1,4 @@
1
- ### 前提・実現したいこと
2
- sqlserverで
3
- 後でデータを追加しても二つ目の図のように表示できるようにしたいです。
4
-
5
- ### のExcelの表
1
+ ```こに言語入力
6
-
7
- ![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
8
-
9
- ### 下の図のように出力したい
10
-
11
- ![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
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
+ ![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
46
+
47
+ ### 下の図のように出力したい
48
+
49
+ ![イメージ説明](adc16fdd759b5c242ddf90d1969c2e64.png)
50
+
51
+
52
+ ### 試したこと
53
+
54
+
53
55
  この書き方だとデータがふえると手間になります。
54
56
  たぶん規則性があるんでしょうけど
55
57
  どなたかよろしくお願いします。

2

修正

2020/03/26 00:56

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- エクセルをselect文で抽出したい。
1
+ SQLSEVER 縦文字列をselect文で横に抽出したい。
body CHANGED
File without changes

1

誤字

2020/03/25 13:26

投稿

退会済みユーザー
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
- [イメージ説明](98c1ccc2f2821597c0411daee90f140a.png)
7
+ ![イメージ説明](ac83c051272e52310af4ccfa0fa1016f.png)
9
- ```
10
8
 
11
9
  ### 下の図のように出力したい
12
10