Code: |
TRK# Policy# Card# Timestamp Amount# 1 aaaa 1111 2017-04-07-19.45.08.515588 100.00 2 aaaa 1111 2017-05-07-19.45.08.515588 100.00 3 aaaa 1111 2017-06-07-19.45.08.515588 100.00 4 aaaa 2222 2017-07-07-19.45.08.515588 100.00 5 bbbb 3333 2017-04-07-19.45.08.515588 200.00 6 bbbb 3333 2017-05-07-19.45.08.515588 200.00 7 cccc 4444 2017-04-07-19.45.08.515588 300.00 8 cccc 5555 2017-05-07-19.45.08.515588 300.00 |
Code: |
TRK# Policy# Card# Timestamp Amount# 3 aaaa 1111 2017-06-07-19.45.08.515588 100.00 4 aaaa 2222 2017-07-07-19.45.08.515588 100.00 |
Code: |
TRK# Policy# Card# Timestamp Amount# 6 bbbb 3333 2017-05-07-19.45.08.515588 200.00 |
Code: |
TRK# Policy# Card# Timestamp Amount# 7 cccc 4444 2017-04-07-19.45.08.515588 300.00 8 cccc 5555 2017-05-07-19.45.08.515588 300.00 |
Code: |
SELECT * FROM your_tbl WHERE TRK# IN (SELECT MAX(TRK#) FROM SPARK0_TBL GROUP BY POLICY# ,CARD#) ; |
Code: |
SELECT POLICY# ,CARD# ,MAX(TSTMP) FROM your_tbl GROUP BY POLICY# ,CARD# ; |
Code: |
---------+---------+---------+---------+---------+---------+---------+---------+ POL# TRK# CARD# SYS_TMSTMP ---------+---------+---------+---------+---------+---------+---------+---------+ 939560000 9422142447956 4985XXXXXXXX9466 2022-07-15-05.33.39.855187 939560000 9422142447956 4985XXXXXXXX9466 2022-06-17-22.13.43.368966 939560000 9422142447956 4985XXXXXXXX9466 2022-05-22-20.34.48.979253 939560000 9221239951859 2230XXXXXXXX9629 2022-04-22-09.42.13.973582 |
Code: |
SELECT * FROM your_tbl WHERE (POL#,SYS_TMSTP) IN (SELECT POL# ,MAX(SYS_TMSTP) FROM your_tbl GROUP BY POL#) ; |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours