• Bhupinder Walia 10
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
How we can sort below in Apex by color value.

[
{"text":"LETTER SENT","color":"RED"},
{"text":"ASSIGNED","color":"YELLOW"},
{"text":"LOAN","color":"GREEN"},
{"text":"MITIGATION","color":"RED"},
{"text":"PENDING ","color":"YELLOW"},
{"text":"RHI","color":"GREEN"},
{"text":"CIT","color":"YELLOW"}
]
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