How can I sort records from saved databases like VARCHAR . I tried the code below without success. How can I format to get the expected order?
SELECT *, CAST(representantes_vendas.valor AS INT) FROM representantes_vendas
INNER JOIN representantes ON representantes_vendas.codigo_repre = representantes.codigo
ORDER BY representantes_vendas.valor DESC
//Resultado Obtido
2017 99.948,54
2017 99,27
2017 91,10
2017 97.757,23
//Resultado esperado
2017 99.948,54
2017 97.757,23
2017 99,27
2017 91,10