Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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]
Comment

PREVIOUS NEXT
Code Example
Sql :: between sql server 
Sql :: with postgres 
Sql :: row to value to json in sql server 
Sql :: sql right join with where clause 
Sql :: select distinct after join 
Sql :: where with multiple conditions in mongodb 
Sql :: insert into using contant values and source table columns with sql 
Sql :: android studio SQLiteDatabase delete all data in database 
Sql :: sql server to uppercase 
Sql :: mysqlclient error 
Sql :: mysql delete rows 
Sql :: insert snowflake 
Sql :: sql count total by foreign key 
Sql :: SQL: get date difference in minutes 
Sql :: mysql select row with min date 
Sql :: Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘a’. 
Sql :: object dependencies in oracle 
Sql :: postgres week number 
Sql :: sample in sql 
Sql :: df to sql pandas sql achemy 
Sql :: mysql create table query 
Sql :: sql select date add day 
Sql :: truncate oracle 
Sql :: command to give readonly access to a postgres sql user 
Sql :: sql use not in 
Sql :: sql primary key syntax 
Sql :: mssql-cli usage 
Sql :: order by ip address sql 
Sql :: android sqlite database example 
Sql :: postgresql database url 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =