What I need to do is to get all the combinations of the records from a query. Let's say that my query gives me the records: 1,2,3,4 I need to also get these: 1,2,3 1,2,4 1,3,4 2,3,4 AND 1,2 1,3 1,4 2,3 2,4 3,4 This is for a betting application and when the player chooses 4 games or more I need to calculate the odds for the combinations of 3 matches and 2 matches... I hope that's clear enough. Thanks all in advance.
it's just a SELECT query: SELECT id FROM myTable WHERE id <= x; and the results are: 1 2 3 4 . . x and what i need is the combinations of (x-1), (x-2), ..., 2 Is that more clear??