Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85734ff

Browse files
committed
For a join by key we need to also compare by duplicate numbers to make sure that we have same amount of rows when rows are identical but row counts is different.
1 parent 39ff2ed commit 85734ff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ create or replace package body ut_compound_data_helper is
300300
ut_utils.append_to_clob(a_partition_stmt,' row_number() over (partition by '||l_partition_tmp||' order by '||l_partition_tmp||' ) ');
301301

302302
if a_pk_table.count > 0 then
303-
-- If key defined do the join or these and where on diffrences
304-
a_join_by_stmt := ut_utils.table_to_clob(l_join_by_list, ' and ');
303+
-- If key defined do the join or these and where on diffrences as well as on duplicate number when rows are same.
304+
a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_join_by_list, ' and ');
305305
elsif a_unordered then
306306
-- If no key defined do the join on all columns
307307
a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_equal_list, ' and ');

0 commit comments

Comments
 (0)