Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. SELECT Id,
  2. (SELECT Business_Unit__c, Department__c, Role__c FROM Account_Roles__r WHERE Role__c IN :roles AND Business_Unit__c IN :businessUnits ORDER BY CreatedDate DESC NULLS FIRST )
  3. FROM Account
  4. WHERE Id IN :accIds
  5. AND Id IN (SELECT Account__c FROM SKY_Account_Role__c)
  6. ORDER BY Name ASC NULLS FIRST
  7.  
  8. SELECT Id,
  9. (SELECT Business_Unit__c, Department__c, Role__c FROM Account_Roles__r WHERE Role__c IN :roles AND Business_Unit__c IN :businessUnits ORDER BY CreatedDate DESC NULLS FIRST )
  10. FROM Account
  11. WHERE Id IN :accIds
  12. AND Id IN (SELECT Account__c FROM SKY_Account_Role__c WHERE Id IN :accIds)
  13. ORDER BY Name ASC NULLS FIRST
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement