SELECT stmt for round robin matrix permutations.
Posted in 2013
I have a company with 320 persons. I recently implemented a Management By Objectives (MBO) program where each worker is assigned goals to be completed on a monthly basis. One of the recurring goals is to arrive on time at work to attend a 30 minute coffee and dounut meeting each morning. The meeting is held in our dinning hall which has 50 tables. Each table seats 8 persons. This means plus or minus 80 seats are empty each working day. I want to generate a round robin seating arrangement so that each person can meet and collaborate with every other person on a rotating basis. This is not an excersise or school assignment. It is same as the "Social Golfer Problem". A friend who uses the APL programming language told me she could generate the desired results with one line of code, but we only Informix 11.70. So I have an SQL table with the following columns: employee.id INT {unique primary key} employee.FullName VARCHAR The following one line of APL programming code generates matrix permutations: pmat2←{{,[⍳2]↑(⊂⊂⎕io,1+⍵)⌷¨Έ 2;¨↓∘.=⍨⍳1+1↓⍴⍵}⍣⍵⍉& #9066;⍬} In SQL, can I generate the desired results with one SELECT statement or do I need multiple SELECT INTO TEMP statements? What should my SELECT statement/s look like?