java - 数据库查询排序问题,如何按字符串中的数字排序?
ringa_lee
ringa_lee 2017-04-18 10:55:03
0
3
579
  1. 按照特定字段排序,字段格式如APPLE_+十进制数字,需求为结果按照除去前缀的数字排序

  2. 存在若干条数据,需要分页显示,如1000条数据,每页25条,需要保证整体顺序,因此一次查询25条后在内存中排序不能满足整体有序。

  3. 阻塞:只按照该字段进行排序会出现APPLE_2APPLE_100之后出现。

对数据库不太熟悉,有没有什么好的解决方案,满足以上要求,谢谢。

ringa_lee
ringa_lee

ringa_lee

reply all(3)
PHPzhong

ORDER BY CONVERT(SUBSTR(column, 6), SIGNED INTEGER)

PHPzhong

Also learning database

Ty80

If it is an Oracle database, your query field rules can be unified. The SQL is as follows:` select wiid,SUBSTR(wiid, 12) from

sys_widesc where wi_theme='XXXX' ORDER BY SUBSTR(wiid, 12)` The query can be displayed according to paging.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template