Forum OpenACS Q&A: Re: Issues with List-builder and grouping

Collapse
Posted by Andrei Popov on

Hmmm... Looks like something I wanted to use as well at some point, but was not really sure how.

Anyway, given the setup, I don't think it'd work, and here's why:

 a_id | a_name |  b_name   |  c_name
------+--------+-----------+-----------
    1 | first  | 1b 1 of 2 | 1c 1 of 1
    1 | first  | 1b 2 of 2 | 1c 1 of 1
    2 | second | 2b 1 of 2 | 2c 1 of 2
    2 | second | 2b 1 of 2 | 2c 2 of 2
    2 | second | 2b 1 of 2 | 2c 1 of 2
    2 | second | 2b 1 of 2 | 2c 2 of 2
    3 | third  | 3b 1 of 1 |
    4 | fourth |           | 4c 1 of 1

This is, as I'm sure you recognized, a result of your select. Note the highlighted part -- you've got multiple combinations of the same b_name and c_name, and I think that listbuilder get completely lost -- it's sort of like doing a join, but forgetting to provide a proper key, ending up with a product...

What could help (but I think this is *not* what you're looking for), is to first do a select out of tables B and C if distinct names and a-Id's, and then join then onto A...