Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: update one table using another

    This may be simple, but I am not too familiar with databases. What I have is a table, Table1, that is updated regularly. It has about 30 columns, and I want to take a subset of the data from Table1 (10 columns and only certain rows), and regularly copy the data into a different table, Table2, so that I can keep that subset of data in Table2 longer than I keep the data in Table1. I need to automate this functionality, also.

    Hopefully I've explained this well enough. I have ASE 11.9.2.5.

    Thank you for any ideas!

  2. #2
    Join Date
    Nov 2002
    Posts
    207

    Re: update one table using another

    I hope I understood the question. This is waht you can do...

    insert table2(col1, col2, col3, ..., col10)
    select col1, col2, col3, ..., col10
    from table1
    where <condition...>

    and you can execute this SQL using cron or any other tool to be repeated as per your requirement.

    Cheers!
    Manjeet

  3. #3
    Join Date
    Mar 2004
    Posts
    2

    update one table with another

    Thanks Manjeet! I did some initial testing with your suggestion, and it does look like it will do what I need.

Posting Permissions

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