Hi,
I have two tables 'contactinfo' contains 3 fields-- key,ContactModeList_pkey,value,whosinfo_pkey.
'whosinfo' contains fields-- pkey,hisPkey.Here 'contactinfo' table contains 2 rows for the same 'pkey' values.(The 'contactinfo' table contains two data for single whosinfo_pkey)
select whos.hisPkey ,
IF(ContInfo.ContactModeList_Pkey = 1, value, '') 'Mobile',
IF(ContInfo.ContactModeList_Pkey = 2, value, '') 'Email'
from whosinfo whos,contactinfo ContInfo where whos.pkey=ContInfo.whosInfo_pkey
and whos.pkey = '397';
The data in table 'contactinfo' as 422,1,8708708700,397 in next row 423,2,8708708700,397.
The data in table 'whosinfo' as 397,401.
The ouput will be as following:
But I want to generate the output in single line as follows
Can any one help me to do this?