-
Notifications
You must be signed in to change notification settings - Fork 0
The Soql.InnerQuery Class
Jason Siders edited this page Jun 29, 2025
·
8 revisions
Represents inner query logic, used for filtering results in a WHERE clause. Use this in conjunction with the addWhere SOQL method. For example:
SELECT Id
FROM Account
WHERE Id IN (
SELECT AccountId
FROM Opportunity
WHERE IsWon = true
)Soql.InnerQuery innerQuery = new Soql.InnerQuery(Opportunity.SObjectType)
?.addSelect(Opportunity.AccountId)
?.addWhere(Opportunity.IsWon, Soql.EQUALS, true)
?.toInnerQuery();
Soql soql = Database.Soql.newQuery(Account.SObjectType)
?.addWhere(Account.Id, Soql.IN_COLLECTION, innerQuery)
?.toSoql();InnerQuery(SObjectType objectType)
This class inherits the Soql.Builder's query building methods, documented here.
- Generating Test Records
- Dml
- Soql
- Cmdt
- Duplicates
- Plugins
- DatabaseLayer
- DatabaseLayerTestUtils
- Dml
- MockDml
- MockRecord
- Cmdt
- MockCmdt
- Duplicates
- MockDuplicates
- MockSoql
-
Soql
- Soql.AggregateResult
- Soql.Aggregation
- Soql.Binder
- Soql.Builder
- Soql.Condition
- Soql.ConditionalLogic
- Soql.Criteria
- Soql.Cursor
- Soql.Function
- Soql.InnerQuery
- Soql.InvalidParameterValueException
- Soql.LogicType
- Soql.NullOrder
- Soql.Operation
- Soql.Operator
- Soql.ParentField
- Soql.PreAndPostProcessor
- Soql.QueryLocator
- Soql.Request
- Soql.Scope
- Soql.Selectable
- Soql.SortDirection
- Soql.SortOrder
- Soql.Subquery
- Soql.TypeOf
- Soql.Usage
- Soql.WhenClause