Re: numeric sorting on a char field having a decimal
Posted in 2006
Marco said:
select c from t order by c+0, length(c)
Nice work Marco, but I think he wants the following
select abbinormal, abbinormal::int, length(abbinormal),abbinormal::decimal(10,5) - abbinormal::int from decimaul order by
2,3,4 ;
abbinormal (expression) (expression) (expression)
7.4 7 3 0.40000
7.5 7 3 0.50000
7.11 7 4 0.11000
7.23 7 4 0.23000
7.24 7 4 0.24000
7.29 7 4 0.29000
7.34 7 4 0.34000
7.40 7 4 0.40000
7.45 7 4 0.45000
8.4 8 3 0.40000
8.5 8 3 0.50000
8.11 8 4 0.11000
8.23 8 4 0.23000
8.24 8 4 0.24000
8.29 8 4 0.29000
8.34 8 4 0.34000
8.40 8 4 0.40000
8.45 8 4 0.45000