[SalesForce] getting the owner’s name from a SOQL query

Is there a way to get the Name from the OwnerId and Account__r.OwnerId in this query?

Select Id, Name, OwnerId,Account__r.Name, Account__r.OwnerId from Sede_BU__C WHERE RecordtypeId = '01224000000B3JL'

Thanks

Best Answer

You can access the name of the owner using Owner as the name of the relationship between the objects.

Owner.Name, Account__r.Owner.Name
Related Topic