Need Help Modifying SQL Code to Include Submitter's First Name and Last Name as Separate Variables
Does anyone know how to modify the below SQL code to include submitter's first name and last name as separate variables? I tried to modify it, but it came up with errors.
-- about the submitter
SUBMITTER.USER_NAME AS SUBMITTER_UNAME, -- $submitter_uname
SUBMITTER.FULL_NAME AS SUBMITTER_FNAME, -- $submitter_fname
SUBMITTER.EMAIL AS SUBMITTER_EMAIL, -- $submitter_email
Any help will be highly appreciated.
Answer Chosen by the Author
As long as all your "FULL_NAME" fields are structured like "FIRST_NAME LAST_NAME" then this will work:
select Substring_Index(FULL_NAME, ' ',1) as Name,
Substring_Index(FULL_NAME, ' ',-1) as Surname