I have one column which I want to divide into three columns
Name
Jack,Jon Man
to be like
first_name , middle_name , last_name
jack , Jon , Man
The first name is followed by a comma and the middle name is followed by space.
I have one column which I want to divide into three columns
Name
Jack,Jon Man
to be like
first_name , middle_name , last_name
jack , Jon , Man
The first name is followed by a comma and the middle name is followed by space.
Sample data :
Query :
Output :
Goodluck and Merry Christmas!
This is easy to do with the
REGEXP_SUBSTR()
function. Find out more.This query identifies the first, second and third occurrence of alphabetical characters. Provided there is a delimiter it doesn't matter what it is.
If we are just selecting the data, it can be done using simple substring functions. For instance