#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    98
    Rep Power
    3

    Transfer select column values to seperate table


    I am trying to copy the values of 3 columns for all 120 rows in TableA to 3 columns with matching column names in TableB. Is there a simple way to do this?

    Example:

    TableA Over 100 Rows
    Model
    Class
    Subclass
    + more columns, I just need the 3 above

    TableB Empty
    Model
    Class
    Subclass

    Any easy way to do this?
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    Code:
    INSERT
      INTO tableB
    SELECT model
         , class
         , subclass
      FROM tableA
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo