OracleDev Posted September 10, 2014 Report Posted September 10, 2014 account_number interaction SEQ_NUM status error_message created_date 1 BP 1 SUCCESS 9/3/2014 10:32 1 BP 2 ERROR not exist 9/4/2014 11:33 1 BP 3 ERROR not valid 9/6/2014 10:32 1 CAC 1 ERROR not valid 9/7/2014 10:32 1 AP 1 SUCCESS 9/8/2014 10:32 1 AP 2 ERROR not exist 9/9/2014 10:32 1 AP 3 SUCCESS 9/1/2014 10:32 Output only interaction ki unna highest seq_num meedha ravali and order by created_date desc ani undali. and highest seq_num success unte aa interaction ranavasaram ledhu like account_number intercation seq_num error_message created_date 1 BP 3 not valid 9/6/2014 10:32 1 CAC 1 not valid 9/7/2014 10:32
mettastar Posted September 10, 2014 Report Posted September 10, 2014 select A.ACCOUNT_NUMBER, A.INTERACTION, A.SEQ_NUM, A.ERROR_MESSAGE, A.CREATED_DATE FROM TABLEX A , ( select INTERACTION, max(SEQ_NUM) SEQ_NUM from TABLEX group by INTERACTION ) B where A.INERACTION=B.INTERACTION and A.SEQ_NUM=B.SEQ_NUM
CheGuevara Posted September 10, 2014 Report Posted September 10, 2014 select A.ACCOUNT_NUMBER, A.INTERACTION, A.SEQ_NUM, A.ERROR_MESSAGE, A.CREATED_DATE FROM TABLEX A , ( select INTERACTION, max(SEQ_NUM) SEQ_NUM from TABLEX group by INTERACTION ) B where A.INERACTION=B.INTERACTION and A.SEQ_NUM=B.SEQ_NUM Add interaction != 'success' to this
mettastar Posted September 10, 2014 Report Posted September 10, 2014 Add interaction != 'success' to this ya agreed adi chusukole.. only latest anukuna
Recommended Posts