我有下表,我需要将 Check_Status 从 Completed 更新为“Not Completed”以获取特定 Prod_ID 的最大 Transaction_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
我的结果应显示如下,即产品 IDXA
的最大 Trans Id 为 107893,应更新为“未完成”。其余的东西应该不变。对于其他产品 IDXB
和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