“split string and get first and last element in sql server” Code Answer’s
“split string and get first and last element in sql server” Code Answer’s split first name and last name in sql sql by Kwams on Aug 02 2021 Donate Comment 0 1 # Name of table = names_table 2 # Name of column containing names = full_name 3 # Simply change the table and column name to what corresponds with your dataset 4 5 SELECT LEFT ( full_name , STRPOS ( primary_poc , ' ' ) - 1 ) AS first_name , 6 RIGHT ( full_name , LENGTH ( primary_poc ) - STRPOS ( primary_poc , ' ' )) AS last_name , name 7 FROM names_table ; 8 9 # NB: This does not capture middle names sql server split string last sql by Bad Beaver on Oct 14 2021 Comment 0 1 SELECT SUBSTRING ( string , LEN ( string ) - CHARINDEX ( '/' , REVERSE ( string )) + 2 , LEN ( string ) ) FROM SAMPLE ; Source: stackoverflow.com Split string and get first and last element in sql server sql by Cool Dev ...