Hello everyone
I need a solution for my problem. The solution can be a simple PL/SQL block or a trigger
I have a table called T_SBSTTN_VLTG_MSTR with following data
SBSTTN_CD VLTG STTS DT_ENTRY FK_TM_ID
10111111 11 Existing 2/9/2009 19:32 10144
10111111 33 Existing 2/9/2009 19:32 10144
10111111 132 Existing 2/9/2009 19:32 10144
10111112 132 Existing 2/9/2009 19:32 10144
10111112 65 Existing 2/9/2009 19:32 10144
My requirement is that I need to insert the above data (based on SBSTTN_CD) into a new table called T_SBSTTN_RTNG_MSTR
The table would be almost similar but except that VLTG column will be replaced by a column RTNG. The values of RTNG should be populated based on the below methodology
The rating should be 'Higher Value' / 'Next higher value'. Keeping the above table in mind the output would be
SBSTTN_CD RTNG STTS DT_ENTRY FK_TM_ID
10111111 132 / 33 Existing 2/9/2009 19:32 10144
10111111 33 / 11 Existing 2/9/2009 19:32 10144
10111112 132 / 65 Existing 2/9/2009 19:32 10144