Following in my sql fiddle: http://sqlfiddle.com/#!2/62429/2
I have a username , which i need to split between first name and last name . One logic I have in mind is to get last name as per father name means if Nick samuel is username and samuel james is father's name
as samuel is in fathers name so it becomes last name for user and remaining becomes first name for user. Kindly let me know how can i implement this logic in my fiddle. Moreover, lets say if there is not match between father name and username then as per our predefined ratio (count of username string spearated by " " so for name nick jhon
count is 2 and its divied by 2 which gives 1, so for that computed value we'll make first name the first part of the string i.e jhon and rest become last name and for names like jammie james jonathan bing
then its count being divided by 2 and gives 2 so in this case first two strings are become first name and remaining becomes last name) . I was confused in implementing both logics so i asked for help. Thanks