I have a table in mysql datbase name as communication
and its columns and values are:
and contact
table and its columns and values are:
From above tables I have a requirement to select values like following:
contact_id
f_name
l_name
phone_number
email_address
creation_date
Actually I am not a database programmer. And you may ask what have you tried so far?
. I do not have any idea to try this. Every problem has solution so I asked here instead to change database design and also do not know is this stupid idea or not.
If anyone have solution it would be great help for me.
Note: email_address and phone_number comes from communication
table with the help of medium
field. And communication
table can have only two medium i.e. MAIL
and PHONE
. EMAIL
was wrong record so EMAIL
is also MAIL
.
Thanks
You have to join
communication
twice, depending onmedium
. This should do the job (untested):