On Tue, 8 Jun 2004, Paul McNeil wrote: > I have never done anything like this but after looking at the spec's I have > a possible direction for you.... > > In String functions there is > > LOCATE(substr,str,pos) > The first syntax returns the position of the first occurrence of substring > substr in string str. The second syntax returns the position of the first > occurrence of substring substr in string str, starting at position pos. > Returns 0 if substr is not in str.
Yes, this is the approach I was thinking of using but: select locate(' ','surname',1) from advisers just returns 0 for all records, whether or not they contain the ' ' space substring. > I think that if you create a function that uses this to strip the string to > the left of the last found space and that returns the string to the right > you could call this in your query and use it in the order by statement. Well, this would probably work if I could get the above statement to work. Andy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]