SQL Server 2008 R2中数据的字母数字数据排序 [英] Alphanumeric Data sorting of Data from SQL Server 2008 R2

查看:244
本文介绍了SQL Server 2008 R2中数据的字母数字数据排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

当数据采用以下格式时,我对来自SQL Server 2008 R2的数据进行排序时遇到问题:-

1).女BC-1铸件
2).女BC-1针状衬套
3). BC-10女铸件
4).母BC-10销轴套联轴器

就像上面列出的数据一样,列表应按以下顺序排列:-

1). BC-1女铸件
2). BC-10女铸件
3).女BC-1针状衬套
4).母BC-10销轴套联轴器

我在这里检查的是字符串为字母数字格式,因此order by子句无法对其进行排序.但是如何解决一个字母数字字符串.有人可以建议相同的解决方案吗?

Dear Friends,

I have a problem in the sorting of data coming from SQL Server 2008 R2 when the data is in this format:-

1). Female BC-1 Casting
2). Female BC-1 Pin Bush
3). Female BC-10 Casting
4). Female BC-10 Pin Bush Coupling

Like in the data above listed the listing should be in the order:-

1). Female BC-1 Casting
2). Female BC-10 Casting
3). Female BC-1 Pin Bush
4). Female BC-10 Pin Bush Coupling

What i have examined here that the string is in alphanumeric format so the order by clause is not able to sort it. But how to solve an alphanumeric string. Can any one suggest any solution for the same?

Thanks

推荐答案

拆分并排序传入的数据.
split and sort the incoming data.


这篇关于SQL Server 2008 R2中数据的字母数字数据排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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