1

Hi i want help in soql query, i want the record that are multiple of 12 for Age__c number field. For example if record that has age field as 12, it should return the record, if 23 no record. How to achieve this?

SELECT Id, Name,Age__c FROM subtype__c 
0

1 Answer 1

4

Create list of integer with multiple of 12, And pass the list into SOQL"IN"

List<integer > ageList=new List<integer >();  
for(integer i=1;i<10;i++)
    ageList.add(i*12);

List<subtype__c> subtypes=[SELECT Id, Name,Age__c FROM subtype__c where Age__c in : ageList];

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .