0

How to get the most recently created record based on datetime using SQL in marketing cloud?

Sql:

SELECT TOP 1
    Name,
    Email,
    DateTime
FROM
    DateBasedDE
ORDER BY
    DateTime DESC
1

try like this query

SELECT 
 Name, Email, DateTime FROM (
SELECT   Name, Email, DateTime, 
 ROW_NUMBER() OVER(PARTITION BY Email ORDER BY DateTime DESC) AS RowNumber FROM 
 Unique_data_AM_01) t1
 WHERE t1.RowNumber = 1
  • Great!! Thank you – Shriya Aug 7 '19 at 9:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.