+ Start a Discussion
Sree SalesforceSree Salesforce 

need a Query Problem:- I have two accounts , account related to three contacts . When i query i need recently created records

User-added image
I need a query , when i query i want to get rectly created records , i.e c3 and c6 contacts only i need.
How shall write query.
Could please hel me
pranoti patilpranoti patil
Hi sri manne,

Use below query.

select id,name,(Select id,createddate from contacts order by createddate desc limit 1 ) from account 

kindly mark it as an answer if that resolves your query.