I get this from a table John Doe
.
What is the best way to split this to have into two variable this :
lastName = 'Doe';
firstName = 'John';
I guess this should work :
SELECT SUBSTR(NameColumn, 1, INSTR(NameColumn,' ',1)) AS firstName,
SUBSTR(NameColumn, INSTR(NameColumn,' ',1)+1) FROM tablName