I think you want:
order by coalesce(Company_Name, First_Name)
However, this is assuming that Company_Name
is NULL
and not blank. You might need an extension of your logic:
order by (case when Company_Name is not null and Company_Name <> ''
then Company_Name
else First_Name
end)
I'm not sure what the desc
is for in your example. Your desired results are in ascending order.