SELECT MsgID, Name FROM tbl_message INNER JOIN tbl_user on tbl_message.UserID = tbl_user.UserID WHERE OrgID ='1' order by MsgID
I have a message table
msgid msg userid Orgid
24 Hi 2 1
25 hsa 4 1
User table
userid Name Orgid
2 cas 1
4 asd 1
I want to get the name from user table. I am doing inner join to get it but I am getting error. what is wrong with the query. Error is OrgID is ambiguous
You can use the given query:
I hope this will help you out.