我有以下 SQL 查询:
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
通过我的排序,我想先显示 e.entity_name 为空的情况,然后按字母顺序对列的其余部分进行排序。这可能吗?