I have some strings in my database. Some of them have numeric values (but in string format of course). I am displaying those values ordered ascending.
So we know, for string values, 10 is greater than 2 for example, which is normal. I am asking if there is any solution to display 10 after 2, without changing the code or the database structure, only the data.
If for example I have to display values from 1 to 10, I will have:
- 1
- 10
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
What I would like to have is
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Is there a possibility to ad an “invisible character or string which will be interpreted as greater than 9”. If i put a10 instead of 10, the a10 will be at the end but is there any invisible or less visible character for that.
So, I repeat, I am not looking for a programming or database structure solution, but for a simple workaround.
You could try appending the correct number of zeroes to the front of the data: