SQL select order by decimal precision desc

依然范特西╮ 提交于 2020-01-06 08:30:47

问题


I'm interested in finding the most precise decimal values in a database field. I'd like to be able to sort results by descending precision. Is this possible?

e.g.

10.1781253 12345.12435 89.763 1.1 2


回答1:


You need to order by the substring of the part after any dot. This is going to be a DB specific SQL query and since you didn't mention which one you're using I can't give a detailed SQL example.



来源:https://stackoverflow.com/questions/2448712/sql-select-order-by-decimal-precision-desc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!