I have the following SQL query:
SELECT w.financial_year ,
ISNULL(e.entity_name, 'Entity code ' + CAST(w.integer_1 AS VARCHAR) + ' is not available on the entity table. Please add.') ,
COUNT(w.form_guid)
FROM portal.workflow AS w
LEFT OUTER JOIN property.entity AS e -- MS: Do not make inner join! Left outer join allows for exceptions to this case to be handled. Important as source data doesn't use property.entity
ON w.integer_1 = e.entity_id
GROUP BY
w.financial_year ,
w.integer_1 ,
e.entity_name
ORDER BY
w.financial_year , e.entity_name
With my ordering I would like to show cases where e.entity_name was null first, and then sort the rest of the column alphabetically.. Is such a thing even possible?