040, 044P, 041BL, 041W, 041PB
^^ This is the order it is coming out in by using Order By clause.
I think this is how it should appear instead:
040, 041BL, 041PB, 041W, 044P
I know similar questions must have been asked before, but I still can't figure out anything!
Edit: After X.L.Ant's comment, I realized my mistake. Therefore, simple order by clause is working for the test case given above. However, the case is still complicated if the number of digits is not always going to be 3 as GolezTrol mentioned. What should one do in that case?