PattiN
asked on
SQL Substring Extraction
I need to use SQL to extract first name and last name from a table that stores name as follows:
last_name, first_name mi
ex: 'Doe, Jane L'
'Smith Jr., Frank C'
'Brown M.D., Lawrence'
Thanks!
last_name, first_name mi
ex: 'Doe, Jane L'
'Smith Jr., Frank C'
'Brown M.D., Lawrence'
Thanks!
ASKER
I wasn't clear, sorry. I mean that I need to extract first name as one field and last name as another field from a column in a table that stores the whole name as 'last name, first name mi'. So, in my example above, I need the following results:
from: 'Doe, Jane L'
'Smith Jr., Frank C'
'Brown M.D., Lawrence'
I need two columns in my SQL result set:
First Name Last Name
Jane Doe
Frank Smith Jr.
Lawrence Brown M.D.
from: 'Doe, Jane L'
'Smith Jr., Frank C'
'Brown M.D., Lawrence'
I need two columns in my SQL result set:
First Name Last Name
Jane Doe
Frank Smith Jr.
Lawrence Brown M.D.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's great, thank you!
Open in new window
If that doesn't work, replace all of the & with || - I can't remember which is the correct syntax in Sybase.