I have a table with 4 columns.
real_name_first
real_name_last
alias_name_first
alias_name_last
All rows will always have values in real_name_first and real_name_last.
alias_name_first and alias_name_last by default are set to NULL.
However, when I output my data I need to order them in the following order:
alias_name_first ASC,
alias_name_last ASC
if both present
real_name_first ASC,
alias_name_last ASC
if alias_name_first is NULL
real_name_first
real_name_last
if both alias names are NULL.
Not sure how to get this logic into the query...