Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Posts
    15

    Unanswered: simple loop to populate table with numbers

    I need a very simple piece of code to populate a single
    field in a table .I believe a loop could be used but not sure.

    example:
    id integer

    1
    2
    3
    4
    5
    6
    thanks
    BJ

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    insert into table1
    with temp(i) as
    (
    values(1)
    union all
    select i+1 from temp where i < 100
    )
    select * from temp


    Quote Originally Posted by bobjohnson360
    I need a very simple piece of code to populate a single
    field in a table .I believe a loop could be used but not sure.

    example:
    id integer

    1
    2
    3
    4
    5
    6
    thanks
    BJ
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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