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 <[EMAIL PROTECTED]>
Smokefree DC
http://www.smokefreedc.org
Washington, DC

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to