SQL 按十进制精度 desc 选择顺序 [英] SQL select order by decimal precision desc

查看:46
本文介绍了SQL 按十进制精度 desc 选择顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣在数据库字段中找到最精确的十进制值.我希望能够通过降序对结果进行排序.这可能吗?

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?

例如

10.178125312345.1243589.7631.12

10.1781253 12345.12435 89.763 1.1 2

推荐答案

您需要按任何点之后的部分的子字符串进行排序.这将是一个特定于数据库的 SQL 查询,由于您没有提到您使用的是哪个,我无法给出详细的 SQL 示例.

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.

这篇关于SQL 按十进制精度 desc 选择顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆