Trying...
select distinct 'mf' as Who, fa.FamilyID, fa.UniqueName, fo.UniqueName, fa.Name as FamilyName, fo.Name, NULL, NULL from Family fa, Foundry fo where fa.FoundryID = 796 and fa.FoundryID = fo.FoundryID order by fa.SortOrder limit 25,25
Fail: Expression #1 of ORDER BY clause is not in SELECT list, references column 'fontpool_live.fa.SortOrder' which is not in SELECT list; this is incompatible with DISTINCT