: SELECT ucase( binary lastname ) as surnameuc, lastname as surname, count( ucase( binary lastname ) ) as count, lastname FROM WHERE lastname<>"" AND lastname<>"Unknown"AND lastname<>'[--?--]' GROUP BY surname ORDER by lastname