function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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