I'm trying to select the last created closed won opportunity for an account, this is my query used in talend:
SELECT Id, Name, CreatedDate, AccountId, StageName
FROM Opportunity
WHERE StageName = 'Closed Won'
ORDER BY CreatedDate DESC
LIMIT 1
But for the accounts that the last closed won opportunities were created before today the returned value is null, it only gets the opportunities created today.