Re: sorting library of congress numbers - Mailing list pgsql-general

From Frank D. Engel, Jr.
Subject Re: sorting library of congress numbers
Date
Msg-id E376C14D-6A77-11D9-9730-0050E410655F@fjrhome.net
Whole thread Raw
In response to Re: sorting library of congress numbers  ("Rick Schumeyer" <rschumeyer@ieee.org>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Why not write a function that converts the LOC number to an integer,
such that sorting on those integers will sort the numbers correctly?
Apparently you can even build an index on this type of function now, to
accelerate the sort.

cvt_loc(TEXT) -> INTEGER

ORDER BY cvt_loc(loc_num)


or something like that...

On Jan 19, 2005, at 6:35 PM, Rick Schumeyer wrote:

>> -----Original Message-----
>> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
>> owner@postgresql.org] On Behalf Of Mike Rylander
>> Sent: Wednesday, January 19, 2005 6:10 PM
>> To: Rick Schumeyer; PgSql General
>> Subject: Re: [GENERAL] sorting library of congress numbers
>>
>> On Wed, 19 Jan 2005 17:37:20 -0500, Rick Schumeyer
>> <rschumeyer@ieee.org>
>> wrote:
>>>
>>> I have a table where one of the columns is a library of congress
>>> number.
>>>
>>> I would like to be able to ORDER BY this column.
>>>
>>
>> First off, by LOC numbers do you mean Title Control Numbers like
>> "o00325992" or "i0824506030" with an optional vendor name in front of
>> them?
>
> I mean the library of congress classification numbers.  For example,
> the book "PostgreSQL" by Douglas & Douglas has the classification:
>     QA76.9.D3 D685 2003
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
>
>
- -----------------------------------------------------------
Frank D. Engel, Jr.  <fde101@fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB7vdJ7aqtWrR9cZoRAvd9AJwO9Ev7ZaU3IEXtssjmV6pyj5VcbwCcCtcL
oNbZSA44H4GVfGXMGC5tFZM=
=coyv
-----END PGP SIGNATURE-----



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com


pgsql-general by date:

Previous
From: Mike Rylander
Date:
Subject: Fwd: sorting library of congress numbers
Next
From: Tom Lane
Date:
Subject: Re: Unique Index