最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

按字母顺序对MySQL结果进行排序,但最后一个数字

SEO心得admin38浏览0评论
本文介绍了按字母顺序对MySQL结果进行排序,但最后一个数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

通常,排序是通过将符号排在顶部来完成的,例如0或*或&.这是mysql排序的默认方式.数字和符号,然后按A-Z.但是,这会使通常最丑陋或格式最糟糕的结果浮动到顶部(例如@#$@3423或8 inch或&amp的结果).

Often, sorting is done with symbols sorted to the top, like 0 or * or &. This is the default way that mysql sorts; numbers and symbols and then A-Z. However, that makes the often ugliest or most badly formatted results float to the top (e.g. a result of @#$@3423 or 8 inch or &amp).

所以我想做一个修改后的形式,先字母A-Z,然后是特殊字符.

So I'd like to do a modified form of that, letters first A-Z, and then special characters last.

我将如何创建这种类型的排序? ORDER BY子句中有内容?

How would I go about creating that type of sort? Something in the ORDER BY clause?

推荐答案

基于此页面的Google缓存链接: www.googlecom. ?sa = t& source = web& cd = 3& ved = 0CCUQFjAC& url = http%3A%2F%2Fblog.feedmarker%2F2006%2F02%2F01%2Fhow-to-do-natural-alpha-numeric-sort -in-mysql%2F& ei = Zg2_TZyKDaffiALjjqwo& usg = AFQjCNGS-rX7AmfrumXK8J7bVSj96bSSmQ

Based on a google-cached link to this page: www.google/url?sa=t&source=web&cd=3&ved=0CCUQFjAC&url=http%3A%2F%2Fblog.feedmarker%2F2006%2F02%2F01%2Fhow-to-do-natural-alpha-numeric-sort-in-mysql%2F&ei=Zg2_TZyKDaffiALjjqwo&usg=AFQjCNGS-rX7AmfrumXK8J7bVSj96bSSmQ

原始链接已死. 这是另一个链接,它实际上解释了比第一个链接更好的事情:

Original link is dead. Here is another link which actually explains what is happening better than the first link did:

matthewturland/2008/11/05 /natural-ordering-in-mysql/

您可以尝试

SELECT names FROM your_table ORDER BY names + 0 ASC
发布评论

评论列表(0)

  1. 暂无评论