List:General Discussion« Previous MessageNext Message »
From:Eamon Daly Date:March 24 2005 11:14pm
Subject:Re: a very tricky string extraction
View as plain text  
(Our mail server just flaked out, so apologies if this is a
duplicate.)

That doesn't work for me (I get '12/15/03'), but I like the
way you think, pardner. How about:

SELECT
LEFT(SUBSTRING_INDEX(LEFT(log, LOCATE('Tested this', log)), '\n', -1), 8)
FROM test WHERE log like '%tested this%';

As mentioned by others in the thread, this is fine as a
stopgap, but you should change your table ASAP.

____________________________________________________________
Eamon Daly



----- Original Message ----- 
From: "Keith Ivey" <keith@stripped>
To: <mysql@stripped>
Cc: "Ed Reed" <EReed@stripped>
Sent: Thursday, March 24, 2005 3:53 PM
Subject: Re: a very tricky string extraction


> 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