Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    28

    Unanswered: ? on SQL Scripting

    I need to generate emails address for about 800 students in a MySQL database. Is there a way to write a script that will take the values in the firstname, middlename, and lastname columns and generate email address in a new column based on a format like this: email address= <firstinitial><middleinitial><lastname>@<ourdomain >? Then i would like to be able to export that column and import it into Groupwise.

    Thanks for the help,
    Brian

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    Code:
    select concat_ws('',firstname,lastname,'@','ourdomain') as email from table
    the first two items are single quotes after the bracket. ourdomain only needs to be in quotes if you are appending an actual string. if you are pulling it from the database you won't need the quotes.

  3. #3
    Join Date
    May 2004
    Posts
    28
    thanks for the help, im getting closer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •