RE: How to handle a "the"
| From: | Nold, Mark | Date: | Wed, 05 Jul 2000 04:46:59 +0000 |
| Subject: | RE: How to handle a "the" | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-854@lists.php.net to get a copy of this message | ||
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
In oracle i would do something like,
SELECT
DECODE(substr(ltrim(lower(myt.title_field)),'
')1,3),'the',substr(ltrim(myt.title_field,' '),4) || ', The'
,ltrim(myt.title_field,' ')) as mytitle,
myt.*
FROM
mtable myt
ORDER BY
mytitle
But realistically just grab your data, throw it into an array and remove the
"the" then use a php sort.
mn
-----Original Message-----
From: Digital Hit Entertainment
[mailto:ianevans@friedspamdigitalhit.com]
Sent: Wednesday, July 05, 2000 12:20 PM
To: php-db@lists.php.net
Subject: How to handle a "the"
Getting ready to do a table of film awards and I'm wondering what is the
best way to handle the sorting of "The": is it possible/more efficient
in the SQL select statement or in the PHP scripting?
In other words, "The Green Mile" would come before "High Noon" because
most folks alphabetize titles via what's after the "the".
Is there a way to do that in the SQL select statement? Should I enter it
as "Green Mile, The" and have PHP reverse it somehow?
Thanks again in advance. The quality, helpfulness and friendliness of
these PHP lists has been amazing. You're great teachers!
--
Ian Evans