+ Start a Discussion
GMASJGMASJ 

How to get owner name in soql query

Hi, 

  I want to extract owner name from below query. 
SELECT  Ownerid,Ownerid.name,
                Userid,User.name,
                opportunityaccesslevel,teammemberrole FROM UserTeamMember
I am getting below error message. not able to get the relation name please suggest me how to extract name in soql query

User-added image

Thanks
Raju yadavRaju yadav
Hi GMASJ,
You should fetch owner name like below sample query
SELECT id ,name,owner.Name,ownerid from Account

Thanks
GMASJGMASJ
Thanks for you reply I am trying for UserTeamMember object not for account. I did try your suggestion this didnt work. 
 
SELECT  Ownerid,owner.name,Userid,User.name,opportunityaccesslevel,teammemberrole  FROM UserTeamMember

 
Madhukar_HeptarcMadhukar_Heptarc
Hi GMASJ,

How many unique Owner ID's are thier in this Object?

Thanks & Regards
Madhukar_Heptarc