Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permutation question 1

Status
Not open for further replies.

teach314

Technical User
Jul 29, 2011
183
CA
hello to all - I'm having trouble getting this to work.

I need to find all arrangements of the eight numbers 0, 0, 0, 0, 1, 2, 3, 4.
There are 3 constraints - Reading left to right...

a) 1 appears before 2
b) 1 appears before 3
c) 3 appears before 4

These are valid arrangements...
Code:
ID   v1   v2   v3   v4   v5   v6   v7   v8
100   0    0    1    0    3    0    2    4
101   0    1    2    0    0    3    4    0
102   1    3    4    0    0    2    0    0

Thanks in advance for any hints

 
What have you tried so far and where are you stuck in your code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
hi - well, I made a table tVal holding 0, 1, 2, 3, 4. I set up code like the following, but I can't figure out the WHERE clause. Is my approach all wrong?

SELECT T1.v AS v1, T2.v AS v2, T3.v AS v3, ...etc ... T8.v AS v8
FROM tVal T1, tVal T2, tVal T3,... etc ... tVal As T8
WHERE ???

 
thread701-1673713 You can search this site there are many threads on the subject. I think I cover this one in the listed thread.
 
thanks for the great reference. I hope to be able to use the ideas from 'Permutations without replacement' to work out an answer.
Teach314
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top