I have a MySQL table that keeps details about people, for example:
- Name
- Address
- WorkEmail
- HomeEmail
- Preferred Email (‘WorkEmail’ or ‘HomeEmail’)
I want to select their preferred email only. Is there a neat way to do this using SQL? or will I just need to do this after I pull out the data?
A simple case statement should do the trick: