Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How to get the most recently created record based on datetime using SQL in marketing cloud?
SELECT TOP 1
try like this query
Name, Email, DateTime FROM (
SELECT Name, Email, DateTime,
ROW_NUMBER() OVER(PARTITION BY Email ORDER BY DateTime DESC) AS RowNumber FROM
WHERE t1.RowNumber = 1