I have tried a bunch of different ways of getting a result about the age in only one query. I want to count the contacts that are between 20 to 29 years old and count in another column the contacts that are between 30 to 40 years old in only one query, but I made two queries. Here is the first:
SELECT COUNT(Id) FROM Contact WHERE Age__c >= 20 AND Age__c <= 29
And I have another query like this:
SELECT COUNT(Id) FROM Contact WHERE Age__c >= 30 AND Age__c <= 40
My question is: is there a way to get this 2 parameters in only one query? if so, how? please help