Multiple Trims

This is a discussion on Multiple Trims within the MySQL Database forums, part of the Database Forums category; Given a database with names like "Joe Bob" and "Fred Allen Jr.", the following correctly sorts ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008
Shannon Appelcline
 
Posts: n/a
Default Multiple Trims

Given a database with names like "Joe Bob" and "Fred Allen Jr.", the
following correctly sorts them:

ORDER BY SUBSTRING_INDEX(TRIM(TRAILING ' Jr.' FROM $table.$key),'
',-1)

However, I can't come up with a proper way to trim multiple possible
suffixes (e.g., Jr., Sr., II, or III). I can't seem to use |s and
nesting the trims didn't seem to work either.

Ideas?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:25 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0