I have a string like "Telugu,Praveen Kumar". I need to split this string like First_Name = Praveen, Last_Name= Telugu, Middle_Name= Kumar. Kindly help me out!!!
Asked
Active
Viewed 116 times
-1
-
Seems like you should have stored the name in separate columns instead. – jarlh Oct 06 '17 at 10:30
-
Yes, I have to store them in separate columns after splitting – PraveenKumarTelugu Oct 06 '17 at 10:45
1 Answers
0
Tryn this one:
UPDATE table
SET FirstName = SUBSTRING(FullName, CHARINDEX(',', FullName)+1, CHARINDEX(' ',FullName)-CHARINDEX(',', FullName)-1)
,MiddleName = SUBSTRING(FullName, 0, CHARINDEX(',', FullName))
,LastName = SUBSTRING(FullName, CHARINDEX(' ', FullName)+1, LEN(FullName)-CHARINDEX(' ', FullName)+1)

Morte
- 31
- 6
-
select CONCAT(CONCAT(CONCAT(CONCAT('Telugu',','),'Praveen'),' '),'Kumar') as NAME from dual; I have this again I need to split them in separate columns. – PraveenKumarTelugu Oct 06 '17 at 11:53
-
I realy dont know whats your point.. i wrote you an update for table, where the full name is stored in 'FullName' column.. you wrote here some select without columns, just blind selected values. wtf man? :D – Morte Oct 06 '17 at 12:19