I am trying to make an ORDER BY FIELD work with a wildcard, and have been unsuccessful:
SELECT positions.*,
departments.dept_name,
departments.dept_url,
divisions.dept_name AS div_name
FROM positions LEFT JOIN departments
ON positions.colleague_dept_code = departments.colleague_code
LEFT JOIN departments AS divisions
ON positions.colleague_div_code = divisions.colleague_code
WHERE colleague_id = '$colleague_id'
ORDER BY FIELD(positions.colleague_position_id, 'A%', 'F%', 'T%', 'S%', 'C%')
The colleague_position_id
field has a text ID generated by our MIS system, and I'd like for positions starting with A to display first, F to display second, etc., etc.
Any help you could provide would be greatly appreciated.
Thanks!