I just started working with Oracle recently so please bear with me.
I have a column of names as LASTNAME,FIRSTNAME and I need to extract JUST the last name. I know how to do this in excel, where I want to so search for the "," find the length of characters before the comma and return those characters.
I know to use SUBSTR as my LEFT() function, but I'm stuck from there.
答案 0 :(得分:1)
One method in Oracle is regexp_substr()
:
select regexp_substr(name, '[^,]*')