I have a query like this:
SELECT BookSize(page_count) as Size, count(*) as NmbrBoooks
FROM books
WHERE page_count IS NOT NULL
AND page_count > 0
GROUP BY Size;
The output is as follows:
+-----------+------------+
| Size | NmbrBoooks |
+-----------+------------+
| ExtraLong | 3 |
| Long | 11 |
| Medium | 51 |
| Short | 27 |
+-----------+------------+
I would like to sort this according to the book's length so I have the following row sequence from top to bottom: Short, Medium, Long, ExtraLong.
What is the best way to achieve this?