Can you help me?
my query is
SELECT num FROM sortnum ORDER BY lpad(num, 10, 0)
result of this query is not good
here is the result
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1a
2a
2b
A1
A2
A3
A4
B1
A10
A11
B10
What is the best query for this type of data
i want number first, then data starting with a , then with b
i want result like
1
1a
2
2a
2b
3
4
5
6
7
8
9
10
11
12
13
14
A1
A2
A3
A4
A10
A11
B1
B10
Thanks in advance
Assuming that any alphabetic prefix will be at most one character in length, you could do:
See it on sqlfiddle.