按照特定字段排序,字段格式如APPLE_+十进制数字,需求为结果按照除去前缀的数字排序
APPLE_
存在若干条数据,需要分页显示,如1000条数据,每页25条,需要保证整体顺序,因此一次查询25条后在内存中排序不能满足整体有序。
阻塞:只按照该字段进行排序会出现APPLE_2在APPLE_100之后出现。
APPLE_2
APPLE_100
对数据库不太熟悉,有没有什么好的解决方案,满足以上要求,谢谢。
ringa_lee
ORDER BY CONVERT(SUBSTR(column, 6), SIGNED INTEGER)
Also learning database
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.
ORDER BY CONVERT(SUBSTR(column, 6), SIGNED INTEGER)
Also learning database
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.