A text field named SKU has in it strings like these; 1005693, 88800245, ABC-5846703, XYZ-23710. How can I sort or Order a Select query using the first character in SKU unless the fourth character is a dash, then I want to use the fifth character to sort?
The query should return this;
1005693
XYZ-23710
ABC-5846703
88800245
Not this;
1005693
88800245
ABC-5846703
XYZ-23710
The query should return this;
1005693
XYZ-23710
ABC-5846703
88800245
Not this;
1005693
88800245
ABC-5846703
XYZ-23710