English 中文(简体)
载有数字和信函的外地命令
原标题:Order by a field containing Numbers and Letters

我需要从Delphi XE2下现有的Padadox数据库中提取数据(10年以上)。

(一) 需根据包括下列价值在内的某一领域(例如: 1、2a、100、1 b、50之二......下令取得结果,并做到:

- 1
- 1 b
- 2 a
- 50 bis
- 100

也许可以做些什么,但这些关键词并不存在:

SELECT id, TRIM(TRIM(ALPHA FROM id)) as generated, TRIM(TRIM(NUMBER FROM id)) as generatedbis, etc
FROM "my.db"
WHERE ...
ORDER BY generated, generatedbis

如何以矛盾的方式实现这种秩序?

最佳回答

引证:

SELECT id, CAST( 0  + id AS INTEGER) A 
FROM "my.db" 
ORDER BY A, id
问题回答

这些想法源于:

  1. 采用一种比较/制图功能,将体格重新排列成可比较的东西,可能会在地理上形成一种对客户的划分。

  2. 在表格中增加一栏,其数据是希望分类的,该栏载有可与标准校正比较相比较的数值的修改,因此将按英文字母缩略语与英文字母缩略语表相配合。

  3. 添加一种储存功能,使之与价值观的修改相矛盾,并将这一功能按条款加以利用。

通过修改,我指的是,将扼杀物分成几个部分,并重新加入每个组成部分,使其具有足够的空间,从而使所有组成部分在扼杀中处于同样地位。 只有当你能够有把握地说,对每个构成部分而言,其价值不会超过数据库的一定长度时,才会可靠地开展工作。

I am making these suggestions little/no knowledge of paradox or delphi, so you will have to take my suggestions with a grain of salt.





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签