Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    9

    Unanswered: Need to purposely duplicate records

    I have a small project that I'm working on. My database contains 86 records. What I'm wanting to do is duplicate each record 6 times. Each time a record is duplicated, I'm wanting the values in one of the fields to increase by 1. Here's an example..

    Current Records......

    Col1 Col2 Col3 Col4 Col5
    538 Miami 918 204 A
    538 Miami 918 224 A


    Here's what I would like to have. See how the records are duplicated, but Col5 increases by 1....

    Col1 Col2 Col3 Col4 Col5
    538 Miami 918 204 A
    538 Miami 918 204 1
    538 Miami 918 204 2
    538 Miami 918 204 3
    538 Miami 918 204 4
    538 Miami 918 204 5
    538 Miami 918 204 6
    538 Miami 918 224 A
    538 Miami 918 224 1
    538 Miami 918 224 2
    538 Miami 918 224 3
    538 Miami 918 224 4
    538 Miami 918 224 5
    538 Miami 918 224 6

    Thank you in advance for your help.

    Travis

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Create a numbers table (this is a table with one integer column, containing numbers 1 upwards).
    Code:
    SELECT Col1, Col2, Col3, Col4, number 
    FROM myTable, numbers 
    WHERE number BETWEEN 1 AND 6
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2004
    Posts
    9
    It looks like that did the trick!! Thank you very much.

Posting Permissions

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