MYSQL
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists MYSQL

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old June 12th, 2008, 08:50 PM
Emily Heureux
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
natural sort via substrings

Hi, I am attempting to do a "natural sort" from within mysql, if possible.
So, for example, jane2 would come before jane10, and normal strings would
still sort as expected. I found some solutions, like using length for the
numerical part, but that only works if the strings are the same length.
Ideally, I would like to use substring_index, but stick a regexp in as the
delimiter. So far, it seems you cannot do this. Does anyone know how to
put a regexp as the delimiter in substring_index? For example, I want to do
something like this:



order by substring_index(name, 'regexp [0-9]+', 1);



Is this possible?



-Emily

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists MYSQL > natural sort via substrings


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway