Subject Re: [ib-support] Re: ORDER BY as number when not
Author Todd Brasseur
The reason I need this numerical order of a char column is because we
have one codes table that includes all different kinds of codes. Some
of these types of codes are characters and some are numbers.

Our application is replacing an old DOS version that had separate tables
for each type of code (we have 43 different code types). The users were
complaining because the codes that are all numbers were being sorted:

1
11
2
22
etc.

There were a couple of code types that are mostly numbers but not all.
That is why I needed the stored procedure to create the 'closest'
number of the char.

Todd


Paul Vinkenoog wrote:

> Hi Martijn,
>
> > Actually - WHO decides that this would be the right order:
> >
> > 1
> > 11
> > 20
> > A
> > AA
> > BA
> >
> > ??
> >
> > What kind of order is this? This is a very custom order...
>
> I think "the right order" is what the user/programmer needs at a
> certain point in the application, so it varies from case to case.
>
> Todd wants a numerical sorting in a char column that may also contain
> non-numerical values. I'm sure he'll have his reasons, so that is
> the right order for this query. Or maybe we should say: the ideal
> ordering. Next question of course is: how to achieve it? But it seems
> he's already done that too.
>
> BTW: it was even a little more complicated. I thought he wanted an
> ordering like you showed above. But there may also be values like
> '23B' and he wants them aligned between the real numerals:
>
> 1
> 3
> 3B
> 10
> 12
> 12P9
> 20
> A
> AA
>
> etc.
>
>
> Greetings,
> Paul Vinkenoog
>
>
>
> Yahoo! Groups Sponsor
> <http://rd.yahoo.com/M=251812.3170658.4537139.1261774/D=egroupweb/S=1705115386:HM/A=1564416/R=0/SIG=11ti81skc/*http://www.netflix.com/Default?mqso=60164797&partid=3170658>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.




[Non-text portions of this message have been removed]