Hi All,
I have two tables as shown below .
Table name1: Person_info
PID person_first_name person_last_name person_IND
----------------------------------------------------------------------------
11 ABC Joe A
12 Judy abc A
13 Syam yxz A
14 James mq A
Table name2 : spouse_info (In this table , if SPS_ID is exists then the record will be there Person_Info .
If it null then other columns values present)
PSID SPS_ID spouse_first_name spouse_last_name spouse_IND
---------------------------------------------------------------------------------------------------------------
11 12
13 sama yxz A
12 11
14 Gnya doo A
I am trying to write a query to pick for each person , who is the spouse ? and result should look like this
PID person_first_name SPS_ID spouse_first_name spouse_last_name spouse_IND
--------------------------------------------------------------------------------------------------------------------------------
11 ABC 12 Judy abc A
12 Judy 11 ABC Joe A
13 Syam sama yxz A
14 James Gnya doo A
Thanks
Sai