如何按顺序使用子字符串 [英] How to use substring in order by

查看:77
本文介绍了如何按顺序使用子字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过以下查询来选择具有两个级别的域名,该域名由两个点分隔:

I have the following query to select the domain names that have three levels separated by two dots:

select domainname from db.table
where criteria like ('*.com')
AND domainname like ('%.%.%');

现在,我需要按域名的.%.%部分而不是%.%.%来对结果进行排序.如何将其添加到查询中?

Now, I need to order the results by the .%.% part of the domain name and not %.%.%. How can I add this to my query ?

推荐答案

查看 查看全文

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