I have 2 columns in Table1
: email1 and email2. I need to fetch full name by concatenation of FirstName and LastName which are in some other table and it is associated with the above mentioned email fields. But I need to make sure, if email2 field is there then fetch the associated Name columns, if email2 field is null then fetch values associated with email1. So please advise how I can use ifnull() and to do the inner join? Here is the table structure:
Table1
- email1
- email2
Table2
- FirstName
- LastName
Thanks in advance, Krishna