I have a model for assessment criteria which has a :label field containing string values like
//P1
//P2
//P3
//P4
//M1
//M2
//M3
//M4
//D1
//D2
//D3
//D4
//etc.
I want to order my queries by this field but looking at the number first and then in the order of P, M, D for each number, resulting in:
//P1
//M1
//D1
//P2
//M2
//D2
//P3
//M3
//D3
//P4
//M4
//D4
//etc.
How could I achieve that?
Try this: