Something similar to this should do it:
libname TD teradata noprompt = "< Teradata connection string>" DATABASE = MyDatabase schema = MySchema;
proc sql;
create table Want as
select A.ID1
,A.ID2
,A.Date
from TD.Have as A
inner join
(select ID1
,ID2
,max(Date) as Max_Date
from TD.Have
group by ID1
,ID2
) as B
on A.ID1 = B.ID1
and A.ID2 = B.ID2
and A.Date = B.Max_Date
;
quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.