I have a table with columns: firstName, lastName and emailAddress
firstName and lastName are populated with values but emailAddress column is empty. How do I generate and insert an email address for each person by combining their first and last names?
Advertisement
Answer
if the rows are already inserted the you could use update
assuming that email Address is based on a pattern like firstName.lastName@domain.country
update my_table set emailAddress = concat(firstName, '.',lastName,'@', 'yourdomanin.xyz') ;