TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kavi suja
NA
298
171.7k
MySql - Case -Retrieve data
Jul 17 2013 5:56 AM
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:
hisPkey
Mobile
Email
401
8708708700
401
[email protected]
But I want to generate the output in single line as follows
hisPkey
Mobile
Email
401
8708708700
[email protected]
Can any one help me to do this?
Reply
Answers (
4
)
How to avoid the duplicate Entry ?
How to create a splash screen with progress loading in C# wi