Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 24th, 2003, 02:12 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
SUBSTRING_INDEX

I can find reference to this on the mysql page

select SUBSTRING_INDEX
('www.mysql.com', '.', 2);
-> 'www.mysql'

select SUBSTRING_INDEX
('www.mysql.com', '.', -2);
-> 'mysql.com'

Is there a similar function that would start at at the 1st . and end at the 2nd returning just mysql?

Reply With Quote
  #2  
Old April 24th, 2003, 02:30 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: SUBSTRING_INDEX

how about

SELECT SUBSTRING_INDEX(SUBSTRING_INDEX("www.mysql.com", ".", 2), ".", -1)

?

Reply With Quote
  #3  
Old April 24th, 2003, 03:41 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: SUBSTRING_INDEX

Intresting solution but not exactly what i had in mind - I was hoping there would be a mysql function taht would start at the 1st . and end at the 2nd . without counting from the right so that if the lengeth after the 2nd . varied it wouldn't matter ie

www.mysql.com
www.mysql.com.au and
www.mysql.co.uk

could all return mysql

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > SUBSTRING_INDEX


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 On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | 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 3 hosted by Hostway
Stay green...Green IT