| 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 extraction | Ed Reed | 24 Mar |
| • Re: a very tricky string extraction | Dan Nelson | 24 Mar |
| • Re: a very tricky string extraction | Keith Ivey | 24 Mar |
| • Re: a very tricky string extraction | Keith Ivey | 24 Mar |
| • Re: a very tricky string extraction | Joerg Bruehe | 24 Mar |
| • Re: a very tricky string extraction | SGreen | 24 Mar |
| • RE: a very tricky string extraction | Jay Blanchard | 24 Mar |
| • RE: a very tricky string extraction | Jay Blanchard | 24 Mar |
| • Re: a very tricky string extraction | Ed Reed | 24 Mar |
| • Re: a very tricky string extraction | SGreen | 24 Mar |
| • Re: a very tricky string extraction | Ed Reed | 24 Mar |
| • Re: a very tricky string extraction | Eamon Daly | 24 Mar |
| • Re: a very tricky string extraction | Keith Ivey | 24 Mar |
| • Re: a very tricky string extraction | Eamon Daly | 25 Mar |
| • Re: a very tricky string extraction | Ed Reed | 24 Mar |
