Hi,
I have two tables called header user, inbox. The table structures mentioned below,

User:

NUM_USER    VCH_NAME    VCH_PHONE_NO    VCH_STATUS
1           XXXX        123              Y
2           YYYY        321              Y
3           ZZZZ        456              Y

INBOX    

NUM_ID(P.K) NUM_CUST_ID    NUM_SEND_CALL_ID    NUM_REC_CAL_ID     DTT_DATE
1           10                  2                     1           4/11/2014
2           10                  3                     2           4/11/2014
3           10                  3                                 4/11/2014
4           10                  1                                 4/11/2014

* NUM_SEND_CALL_ID, NUM_REC_CAL_ID ARE FOREIGN  KEY REFERENCES USER TABLE

Now I want to map Inbox table, user table and get the result below mentioned form,

 ID  (Inbox)     Sendername(User table vch_name)    Receivedusername (user tablevch_name )
     1                    YYYY                                      XXXX
     2                    ZZZZ                                      YYYY
     3                    ZZZZ
     4                    XXXX   

Please give some suggestion to achieve my result. 
SELECT        NUM_ID, caller.VCH_NAME as Sendername, user.VCH_NAME AS Receivedusername
FROM            INBOX INNER JOIN
                         User AS caller ON INBOX.NUM_SEND_CALL_ID= caller.NUM_USER LEFT OUTER JOIN
                         USER ON INBOX.NUM_REC_CAL_ID = User.NUM_USER
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.