Find the lastName in SQL table

Is this a temporary or permanent position? avicenna clinic gaborone “I think that’s wishful thinking,” said Holmes’ public defender Daniel King, citing the vast number of potential witnesses–about 4,000–that the state has said may be called to testify.

  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