copy one column to another column with different type, is it possible?

Discussion in 'MySQL' started by jay_ar510, Jul 3, 2013.

  1. #1
    I have a db..
    looks-like this...
    Table: information
    emp_no, lastname, firstname, license_expiration
    K5-001 Bond James 7/12/2013
    K5-002 Bond Jay 12/12/2013

    Table: submittal_tbl2
    emp_no, submittal_name, submittal_code, expiration
    K5-001 License to Exercise WEX-LEP (NULL)
    K5-002 License to Exercise WEX-LEP (NULL)

    i want to copy the column of "LICENSE_EXPIRATION" and paste it in "EXPIRATION" column which the copied column will be in same "EMP_NO", that the value of the license_expiration of K5-001 will not be placed in K5-002 or vice versa... how?

    license_expiration type: datetime
    expiration: date


    i hope someone helps me.. Thanks in advance.... more power.. GOod Luck....
     
    jay_ar510, Jul 3, 2013 IP
  2. macfraser

    macfraser Member

    Messages:
    81
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    You can do a select as (then format the date timestamp to date) as part of an insert with mysql.

    Here is a stackoverflow link with additional details.

    http://stackoverflow.com/questions/3786820/mysql-export-query-as-insert-statements
     
    macfraser, Jul 4, 2013 IP