w3resource

MySQL String Exercises: Append to email field

MySQL String: Exercise-5 with Solution

Write a query to append '@example.com' to email field.

Sample table: employees


Code:

UPDATE employees SET email = CONCAT(email, '@example.com');

Sample Output:

  EMAIL
  --------------------
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  [email protected]
  - - - -  - - - - - - -
  - - - -  - - - - - - -
 

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous:Write a query to display leading zeros before maximum and minimum salary.
Next:Write a query to get the employee id, first name and hire month.

What is the difficulty level of this exercise?



Follow us on Facebook and Twitter for latest update.