You need to sign in to do that
Don't have an account?
Bramha1
Need Soql Query if it is possible
Hi,
I have a Object called download__c and a field agg__c. I have lots of records(e.g 100) in download__c which has agg__c(this is not a picklist) will be having values like Value1, Value2, Valu3 and Value4. So all 100 records will have any value from the four. I can get the these values by doing a query on download__c and iterate through all the records and store the agg__c values in a Set. Is there any other way i could the Set of values. is there any other possibility doing anything in the query ?
Cheers
Bramha
Hi,
I have got the result what i expected using AggregateResult object.
List<AggregateResult> ar = [Select agg__c a , count(Id) from Download__c Group By agg__c ] ;
for(AggregateResult a : ar) {
System.debug('***Hello123***' +a.get('a'));
}
Thanks
Bramha
All Answers
So you want to create a set of all the distinct values stored in agg__c, correct?
Yes, is it possible with a query. I am looking around the AggregatorResults if i could get any solution. If you get a better solution please let me know.
Cheers
Bramha
Hi,
I have got the result what i expected using AggregateResult object.
List<AggregateResult> ar = [Select agg__c a , count(Id) from Download__c Group By agg__c ] ;
for(AggregateResult a : ar) {
System.debug('***Hello123***' +a.get('a'));
}
Thanks
Bramha