V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
luckylion
V2EX  ›  MySQL

查询语句数字排列的问题

  •  
  •   luckylion · Aug 18, 2014 · 3439 views
    This topic created in 4274 days ago, the information mentioned may be changed or developed.
    比如说表中有数据
    101
    105
    112
    201
    202
    501

    查询后得出的结果是
    112
    105
    101

    202
    201

    501

    这样的查询怎样些
    3 replies    2014-08-18 13:16:08 +08:00
    mgc
        1
    mgc  
       Aug 18, 2014   ❤️ 1
    ORDER BY LEFT(col, 1) DESC, ORDER BY col DESC
    luckylion
        2
    luckylion  
    OP
       Aug 18, 2014
    多谢,解决
    sumarklee
        3
    sumarklee  
       Aug 18, 2014
    需要分开写吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2472 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:05 · PVG 16:05 · LAX 01:05 · JFK 04:05
    ♥ Do have faith in what you're doing.