Re: sorting library of congress numbers

From: "Frank D(dot) Engel, Jr(dot)" <fde101(at)fjrhome(dot)net>
To: 'PgSql General' <pgsql-general(at)postgresql(dot)org>
Subject: Re: sorting library of congress numbers
Date: 2005-01-20 00:11:53
Message-ID: E376C14D-6A77-11D9-9730-0050E410655F@fjrhome.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org [mailto:pgsql-general-
>> owner(at)postgresql(dot)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(at)ieee(dot)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(at)postgresql(dot)org
>
>
- -----------------------------------------------------------
Frank D. Engel, Jr. <fde101(at)fjrhome(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-01-20 00:18:27 Re: Unique Index
Previous Message Mike Rylander 2005-01-20 00:08:09 Fwd: sorting library of congress numbers