|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
RE: SUBSTRING_INDEX
how about
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX("www.mysql.com", ".", 2), ".", -1) ? |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > SUBSTRING_INDEX |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|