Answers for "Get first name and last name from full name string in SQL"

SQL
0

Get first name and last name from full name string in SQL

DECLARE @FullName    VARCHAR(50) = 'Mark Zuckerberg'

SELECT SUBSTRING(@FullName, 1, CHARINDEX(' ', @FullName) - 1) AS [First Name],
       SUBSTRING(@FullName, CHARINDEX(' ', @FullName) + 1, LEN(@FullName)) AS [Last Name]
Posted by: Guest on April-30-2021

Code answers related to "Get first name and last name from full name string in SQL"

Code answers related to "SQL"

Browse Popular Code Answers by Language