Here is my table data:
- file_number - status
- ABC099 - running
- ABC100 - running
- ABC101 - removed
- ...
- ABC1001 - removed
- ABC1002 - removed
- ABC1003 - running
- BCA099 - running
- BCA100 - removed
- BCA101 - running
- ...
- BCA1001 - removed
- BCA1002 - running
- BCA1003 - running
This query returns the correct answer with file_number sorted:
SELECT file_number,status FROM table ORDER BY LENGTH(file_number) asc
But I want to sort the status column as well i.e all the running files should come first and removed files should be displayed at the end.
Expected result:
- file_number - status
- ABC099 - running
- ABC100 - running
- ABC1003 - running
- ...
- BCA099 - running
- BCA101 - running
- ...
- BCA1002 - running
- BCA1003 - running
- ABC101 - removed
- ABC1001 - removed
- ABC1002 - removed
- BCA100 - removed
- BCA1001 - removed
FIELD ().