Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct b.ID_Code, b.supply_start_date, b.supply_end_date, b.system_id
- from (
- select ID_Code, max(supply_start_date) as max_dt
- from tmp_mmt_sup
- group by ID_Code) a
- inner join tmp_mmt_sup b
- on a.ID_Code=b.ID_Code and a.max_dt=b.SUPPLY_START_DATE;
- ID_Code Start End System
- 123 01-04-2018 30-04-2018 ABC
- 123 01-04-2018 30-04-2018 DEF
Add Comment
Please, Sign In to add comment