Answers for "sql expression to make an email address based on first name and last name"

SQL
1

create email address from first and last name in sql

# NB: This creates email addresses with the format
# first_name.last_name@company_name.com
# Name of table = names_table
# Name of column containing names = full_name
# Simply change the table and column name to what corresponds with your dataset

WITH temp_table AS (
	SELECT LEFT(full_name, STRPOS(primary_poc, ' ') -1 ) AS first_name,  
  			RIGHT(full_name, LENGTH(primary_poc) - STRPOS(primary_poc, ' ')) AS last_name, name
	FROM names_table)

SELECT CONCAT(first_name, '.', last_name, '@', 'company_name.com')
FROM temp_table;
Posted by: Guest on August-02-2021

Code answers related to "sql expression to make an email address based on first name and last name"

Code answers related to "SQL"

Browse Popular Code Answers by Language