Is it possible to convert the following query to run in MySQL? The query is based on a table called "ardata" which contains the fields 'author', 'lname', and 'fname'. The 'author' field contains the authors first and last name with a space in the middle. I want to convert the names over so the first and last names are in separate fields. I was given this query based on MS SQL but the PATINDEX( ) doesn't work in MySQL. Any suggestions?
UPDATE ardata SET author = LTRIM ( RTRIM ( author )), lname = SUBSTRING ( author, PATINDEX ( '% %', name ) + 1, LEN ( name )), fname = SUBSTRING ( author, PATINDEX ( '% %', name )); Thanks, Tom Johnson -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]