By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

combinations and permutations

P: n/a
Hi,

I'm not at all competent in ms-sql, nor vb, as we work in Oracle and Mysql
.... however, we need to port a couple of db queries to ms-access (2000) and
I'm having a heck of a time trying to make it work.

The immediate requirement is obtaining permutations of a relational
recordset
Specifically each record row will produce up to 3 letters and I need to
display all the combinations of L1, L2, L3, NULL for that row and avoid
reverse combinations (ie L1:L2 is the same as L2:L1) but including
self-referential combinations (ie L1:L1)

ie If the row produced 3 Letters (A,B,C) The subordinate results would be
A : A
A : B
A : C
A : NULL
B : B
B : C
C : C
C : NULL

In oracle you'd use a nested function to do this in mysql a group_concat
..... does anyone have a quick easy solution for ms-access?
many thanks
brendan
Aug 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
the usual way of displaying all combinations of something is to use a
deliberate cartesian product, exactly the same way you would in
Oracle...

Say I had a table of Students and a table of Courses. If I wanted to
see all possible combinations of (Student, Course), it's just

SELECT CourseID, StudentID
FROM Student, Course

note the lack of joins. then you can filter that to get what you want.

Or did I misinterpret the question?

Aug 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.