问题
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