且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在sql中对varchar字段数据进行排序?

更新时间:2022-12-11 20:44:41

子串,& 


39;用于HTML标记。请查看以下链接以获取选项:





如何在sql语句where子句中使用Char(39)? [ ^ ]


I am having the datas as CCD-1,CCD-20,CCD-23 etc. I want to sort them.
I tried the below query but it's not working
select * from X order by RIGHT(TA.CBFieldName,LEN(TA.CBFieldName)-CHARINDEX('-',TA.CBFieldName))

The substring, &


39; is for HTML markup. Please check the link below for options:



How do I use Char(39) in a sql statement where clause?[^]