1 Reply Latest reply: Jan 15, 2013 4:56 PM by rp0428 RSS

    TO INSERT various combinations in a table.

    934896
      I have a table named comb, this has 3 columns XYand Z. These columns can have either Y or N. So I want to have distinct records with Y and N populated. I know the number of rows are 2 raised to the power 3. that would be 2*2*2 = 8.

      Manually I can get this as

      COLX COLY COLZ
      N N N
      N Y N
      N N Y
      Y Y N
      Y N Y
      N Y Y
      Y Y Y

      Those were the 8 distinct rows.
      Now if I have 4 columns it would be 2 raised to the power 4, ie 2*2*2*2 = 16. I have 13 columns and these should have distinct values with either Y or N. the number of rows will be 8192. Can anyone suggest how I could write a program to insert those 8192 rows( a Y or N in 13 columns and each row should be distinct.


      I will appreciate all the help.

      Thanks