I have an issue with a column that is set to text but contains numeric data, when I run my select and try to order by it, it is half correct.
SELECT PRODUCT FROM MY_TABLE ORDER BY PRODUCT
My result is
1000
10010
1002
Where I would like to see it return as
1000
1002
10010
FIX: To get that result, all I did was add the LEN in my order by
SELECT PRODUCT FROM MY_TABLE ORDER BY LEN(PRODUCT), PRODUCT