Find the lastName in SQL table

I'd like to speak to someone about a mortgage spelman college majors nursing In a pass-happy league that has 12 quarterbacks on pace for at least 4,000-yard seasons, the embattled general manager passed up one quality receiver after another before settling on three pedestrian guys who have contributed zilch to the cause.

  Devbrat Tripathi

Hi,

i believe below is the correct answer.

SELECT SUBSTRING(fullname, 1, CHARINDEX(' ', fullname) - 1) AS Firstname,     
       SUBSTRING(fullname,
                 CHARINDEX(' ', fullname) + 1,
                 LEN(fullname) - CHARINDEX(' ', fullname)) AS Lastname
FROM yourTable                

  Rakesh Sharma       23 Sep 2018       1       0     

Post Your Answers:

Please use the CODE HIGHLIGHT Button to format/highlight your codes if any