I have a rows with (firstname, lastname, phone, email). What I want to make is a query which sort first by concat(firstname, lastname) asc and the rest rows, where the firstname and lastname are null have to come after the sorted by concat(firstname, lastname) ascand to be sorted depending on phone/email (if phone is null sort by email, if email is null sort by phone). Any suggestion can help me?
case,coalesce