I have the following table, where I need to update the Check_Status from Completed to ‘Not Completed’ for Greatest Transaction_ID of Specific Prod_ID:
Tran_ID Prod_ID Check_Status
------- -------- ------------
107893 XA Completed
107892 XA Completed
107891 XA Completed
107890 XB Completed
107889 XB Completed
107888 YC Completed
107887 YC Completed
107886 YC Completed
107885 YC Completed
My results should be displayed as following i.e., product id XA has the greatest Trans Id as 107893, should be updated as ‘Not-Completed’. Remaining things should be unchanged. Similarly for other Product Id XB and XC.
Tran_ID Prod_ID Check_Status
------- -------- ------------
107893 XA Not-Completed
107892 XA Completed
107891 XA Completed
107890 XB Not-Completed
107889 XB Completed
107888 YC Not-Completed
107887 YC Completed
107886 YC Completed
107885 YC Completed
1 Answer