- Check for duplicate values in the source table using the following:
/*Check for duplicate values in source table*/SELECT cust_id,count(*) from Hr_payhike group by 1 order by 2 desc
- The output will be generated with CUST_ID =1 and has two values which are causing errors. The reason for this is that while updating the TARGET table, the optimizer won't be able to understand from which row it should update the TARGET row. Who's salary will be updated Will or Bekky?
- To resolve the error, execute the following update query:
/* Update part of MLOAD */UPDATE ACC FROM ACCOUNTS ACC , ( SELECT CUST_ID, CUST_NAME, SAL_HIKE FROM Hr_payhike QUALIFY ROW_NUMBER() OVER (PARTITION BY CUST_ID ORDER BY CUST_NAME,SAL_HIKE DESC)=1) SUPD