質問編集履歴

2

状況更新

2019/03/18 06:17

投稿

raccoondog
raccoondog

スコア77

test CHANGED
File without changes
test CHANGED
@@ -83,3 +83,33 @@
83
83
 
84
84
 
85
85
  ```
86
+
87
+ ※20190318 実行状況
88
+
89
+ ```ここに言語を入力
90
+
91
+ ●SQL
92
+
93
+ update `embulk_test.T_RS_TRAN_TEST` rs set
94
+
95
+ from_org_name = (select org_name from `embulk_test.M_ORG_TEST` where org_code = rs.from_org_code and ROW_NUMBER() OVER `1`),
96
+
97
+ to_org_name = (select org_name from `embulk_test.M_ORG_TEST` where org_code = rs.to_org_code and ROW_NUMBER() OVER `1`),
98
+
99
+ from_subinv_name = (select subinv_name from `embulk_test.M_SUBINV_TEST` where org_code = rs.from_org_code and subinv_code = rs.subinv_code and ROW_NUMBER() OVER `1`),
100
+
101
+ to_subinv_name = (select subinv_name from `embulk_test.M_SUBINV_TEST` where org_code = rs.to_org_code and subinv_code = rs.subinv_code and ROW_NUMBER() OVER `1`) where ( rs.from_org_name is null or rs.to_org_name is null or from_subinv_name is null or to_subinv_name is null);
102
+
103
+
104
+
105
+
106
+
107
+ ●エラー
108
+
109
+ Analytic function not allowed in WHERE clause at [1:145]
110
+
111
+
112
+
113
+
114
+
115
+ ```

1

質問内容の更新

2019/03/18 06:17

投稿

raccoondog
raccoondog

スコア77

test CHANGED
File without changes
test CHANGED
@@ -14,13 +14,13 @@
14
14
 
15
15
  ●加工用のSQL
16
16
 
17
- update `embulk_test.T_RS_TRAN_TEST` rs set from_org_name = (select org_name from `embulk_test.M_ORG_TEST` where org_code = rs.from_org_code and ROW_NUMBER() = 1 ),to_org_name = (select org_name from `embulk_test.M_ORG_TEST` where org_code = rs.to_org_code and ROW_NUMBER() = 1 ),from_subinv_name = (select subinv_name from `embulk_test.M_SUBINV_TEST` where org_code = rs.from_org_code and subinv_code = rs.subinv_code and ROW_NUMBER() = 1 ),to_subinv_name = (select subinv_name from `embulk_test.M_SUBINV_TEST` where org_code = rs.to_org_code and subinv_code = rs.subinv_code and ROW_NUMBER() = 1 ) where ( rs.from_org_name is null or rs.to_org_name is null or from_subinv_name is null or to_subinv_name is null);
17
+ update `embulk_test.T_RS_TRAN_TEST` rs set from_org_name = (select org_name from `embulk_test.M_ORG_TEST` where org_code = rs.from_org_code and row_num = 1 ),to_org_name = (select org_name from `embulk_test.M_ORG_TEST` where org_code = rs.to_org_code and row_num = 1 ),from_subinv_name = (select subinv_name from `embulk_test.M_SUBINV_TEST` where org_code = rs.from_org_code and subinv_code = rs.subinv_code and row_num = 1 ),to_subinv_name = (select subinv_name from `embulk_test.M_SUBINV_TEST` where org_code = rs.to_org_code and subinv_code = rs.subinv_code and row_num = 1 ) where ( rs.from_org_name is null or rs.to_org_name is null or from_subinv_name is null or to_subinv_name is null);
18
18
 
19
19
 
20
20
 
21
21
  ●エラー
22
22
 
23
- Analytic function ROW_NUMBER cannot be called without an OVER clause at [1:145]
23
+ Unrecognized name:row_num at[1:145]
24
24
 
25
25
 
26
26