I want to pull all the parent records which have only 1 child record either using a query or report or any other way. For example all the accounts with only 1 contact record. I don't want to create roll-up summary field.
Query on Contact using Aggregate function
SELECT AccountId, count(Id) FROM Contact GROUP BY AccountId HAVING count(Id) = 1
Hi @sam you can do it in reports also with out creating a Roll-up-summary field.For this you need to create a report with accounts & contacts.
1.For this report you need to use Cross filter like Acccounts with contacts
2.You need to change to summary report with grouping as Account name.
3.You need to create a formula based on RowCount.
You can do it in either query also as ishwar answer.using count with aggregate list.
I hope it solves your problem