+ Start a Discussion
sfdcjoeysfdcjoey 

How to fecth data of different record types for account object using SOQL query?

How to fecth data of different record types for account object using SOQL query?
Best Answer chosen by sfdcjoey
karthikeyan perumalkarthikeyan perumal
Hello 

Use below Query 
 
SELECT Id,Name FROM Account where  RecordTypeId in(Select id from RecordType where SobjectType ='Account')

Hope this will help you, 
Mark Best ANSWER if its works 

Thanks
karthik
 

All Answers

karthikeyan perumalkarthikeyan perumal
Hello 

Use below Query 
 
SELECT Id,Name FROM Account where  RecordTypeId in(Select id from RecordType where SobjectType ='Account')

Hope this will help you, 
Mark Best ANSWER if its works 

Thanks
karthik
 
This was selected as the best answer
Amit Chaudhary 8Amit Chaudhary 8
You can try below simple query to get recordType of account object
Select id,Name from RecordType where SobjectType ='Account'

Let us know if this will help you