0

Can SOQL handle subqueries? For example, to get the row counts of both current and deleted rows in a table..

SELECT 
  (SELECT COUNT(id) FROM SNF___c WHERE IsDeleted = False) is_deleted, 
  (SELECT COUNT(id) FROM SNF___c WHERE IsDeleted = True) is_current

When I execute this in SSIS / TaskFactory SalesForce.Com Source component I receive the error message in the below image:

enter image description here

2

Subqueries are possible but they are not aliasable nor can you select anything that isn't a "child" object of the main object you are selecting. Example right from the documentation:

SELECT Account.Name, (SELECT Contact.LastName FROM Account.Contacts)
FROM Account
  • Okay. In that case I'll run these as separate queries, and merge the results. – Jim Horn Jan 15 '15 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.