I am using two SOQL query in Salesforce.
First Query: Select Id, FirstName, LastName from User where Id='00000ADFEDSFSRTGDR' Second Query: Select IsFrozen from UserLogin where UserId='00000ADFEDSFSRTGDR'
Can we combine these two query into a single query. Please help me on this.
No. If you use "describe" calls on
UserorUserLoginyou'll see they are linked but there's no "relationshipName" field in the describe's result. That's what's used to link, bit like table alias in normal database.So you can do
because
PermissionSetAssignment.AssigneeIdhas relationshipName. But notGoing "up" doesn't work either.
SELECT Account.Name FROM Contactworks OK butSELECT IsFrozen, User.Name FROM UserLogindoesn't. Again - because there's norelationshipNamein the describe results.You'll have to query separately and link them them in code as
Map<Id, User>for example.