List:General Discussion« Previous MessageNext Message »
From:Keith Ivey Date:March 24 2005 9:53pm
Subject:Re: a very tricky string extraction
View as plain text  
Eamon Daly wrote:
> SELECT
> LEFT(SUBSTRING_INDEX(LEFT(log, LOCATE('\n', log, LOCATE('tested this', 
> log)) - 1), '\n', -1), 8)
> FROM test WHERE log LIKE '%tested this%'

Another possibility:

    SELECT SUBSTRING(log, LOCATE('\n', SUBSTRING(log, 1,
       LOCATE('Tested this', log)-1))+1, 8)
    FROM test WHERE LOCATE('Tested this', log);

-- 
Keith Ivey <keith@stripped>
Smokefree DC
http://www.smokefreedc.org
Washington, DC
Thread
a very tricky string extractionEd Reed24 Mar
  • Re: a very tricky string extractionDan Nelson24 Mar
    • Re: a very tricky string extractionKeith Ivey24 Mar
  • Re: a very tricky string extractionKeith Ivey24 Mar
  • Re: a very tricky string extractionJoerg Bruehe24 Mar
  • Re: a very tricky string extractionSGreen24 Mar
RE: a very tricky string extractionJay Blanchard24 Mar
RE: a very tricky string extractionJay Blanchard24 Mar
Re: a very tricky string extractionEd Reed24 Mar
  • Re: a very tricky string extractionSGreen24 Mar
Re: a very tricky string extractionEd Reed24 Mar
  • Re: a very tricky string extractionEamon Daly24 Mar
    • Re: a very tricky string extractionKeith Ivey24 Mar
  • Re: a very tricky string extractionEamon Daly25 Mar
Re: a very tricky string extractionEd Reed24 Mar