how to do select.. into (or maybe insert...into)?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: how to do select.. into (or maybe insert...into)?

  1. #1
    Join Date
    May 2001
    Posts
    285

    Unhappy how to do select.. into (or maybe insert...into)?

    I have 2 tables --

    table1(my_rowid integer, col2 anything)
    table2(my_rowid integer)

    I'd like to copy part of my_rowID from table1 to table2, how can I do that? Do I have to use a cursor for loop? Or I can use select...into or insert...into? I tried a few ways but got no luck

    Thank you and have a nice weekend!

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    perhaps you should write in pseudo-code what you want

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    INSERT INTO table2(my_rowid)
    SELECT my_rowid/69
    FROM table1;
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  4. #4
    Join Date
    Jan 2001
    Posts
    2,828
    Hi Elaine

    How about using the inbuild substr function ? and doing somethin like this

    insert into table2
    select substr(col1,1,2),col2 from tabl1

    regards
    Hrishy

    P.S:Hope i understood your question right

Posting Permissions

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


Click Here to Expand Forum to Full Width