pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@wallace.ece.rice.edu>
To: pgsql-sql@postgresql.org
Subject: Re: SQL command speed
Date: Thu, 18 May 2000 15:39:09 -0500
Message-ID: <20000518153909.B2549@rice.edu> (raw)
In-Reply-To: <200005181938.QAA04835@ant.utdt>
References: <3924405E.15014E6B@wsicorp.com>
	<200005181938.QAA04835@ant.utdt>

Hey crew:
I've got a relatively simple SQL problem. In a db backed web site
we're building, I'd like to fill a dropdown box with the contents of a
validation table, in this case research institutions. I want to sort them
alphabetically, but using "library rules": i.e. skip inital articles,
since we've a few 'The University of Foo" and "The Johns Hopkins
University", for example.

I thought I had it with this SQL:

SELECT InstName from Institutions ORDER BY ltrim (InstName, 'The');

Looked good, until I found 'Texas A&M University' sorting below York.

Seems ltrim() removes inital charaters from the set of charaters, not
inital strings, so I was sorting on 'xas A&M University'

Anyone have some magic solution for this?

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005




view thread (12+ messages)  latest in thread

Message-ID: <20000518153909.B2549@rice.edu>
Permalink:  ../20000518153909.B2549@rice.edu/
Also on:    postgresql.org/message-id/20000518153909.B2549@rice.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: reedstrm@wallace.ece.rice.edu
  Subject: Re: SQL command speed
  In-Reply-To: <20000518153909.B2549@rice.edu>
  References: <3924405E.15014E6B@wsicorp.com> <200005181938.QAA04835@ant.utdt> <20000518153909.B2549@rice.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox