• Mark Valenzuela
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,
I have two object. Student__c (Child) and College__c (Parent).
I want to fetch records of college which are not in Student. So, I have written SOQL like this.

List<college__c> colList = [select id, name from college where ID NOT IN (select college__c from student)];

Now, I have to retrieve colleges from last year (2019) and department equals to Physics. If I am moving to 2021 then I want to see only 2020 records.

How can I modify above SOQL for my requirement.

Please help me.

Thanks in Advance.

Regards,

Ramana V

SOQL Query to retrieve last year records