insert with append

  • I have a table called name1 and this table has 2 columns firstname, lastname.

    I have a 2nd table called name2 with 3 columns firstname, lastname, email.

    I want to take the contents of table 1 and add to table 2 which is easy enough.  However i want colunm 3 on the 2nd table to read like the below.

    firstname.lastname@test.com

    I know this is probably pretty simple, but i am pretty new to this.

  • Welcome to the madhouse.

    INSERT INTO table2 (firstname, lastname, email)
    SELECT  firstname, lastname,  
           firstname + '.' + lastname + '@TEST.COM' AS email
    FROM table1



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply