I was wondering can you combine 2 child objects to a parent object.
SELECT SourceIp FROM LoginHistory WHERE UserId IN (SELECT Id FROM User) SELECT City FROM LoginGeo WHERE CreatedbyId (SELECT Id from User)
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
LoginHistory has a direct relationship to
LoginGeoId. Assuming what you're interested in is to obtain details of the geolocation for each specific
LoginHistory record, you can perform a relationship query:
SELECT SourceIp, LoginGeo.City FROM LoginHistory WHERE UserId IN (SELECT Id FROM User)
For details of the object fields and relationships, the SOAP API Reference for
LoginHistory is helpful.