Subject Re: For listing purposes flattening a many-side-table of a one-to-many relation
Author Bhavbhuti Nathwani
Hi Svein

Thanks for responding. I am not sure if I am asking wrong questions in the right forum, or right questions in the wrong forum ;) but I appreciate an answer nevertheless, even if it says, it cannot be done or wrong forum.

I have tried the LIST() function and yes it returned a single long delimited string with the values from a vertical table. But I was not able to get more details like we would with a join, so something like the following will not work, for me atleast:
SELECT LIST(maccounts.ccode, invoicefooter.nperc, ',')
FROM invoicefooter
join maccounts
on maccounts.iid = invoicefooter.IACCOUNTID

but even something simple like:
SELECT LIST(maccounts.ccode, ',')
FROM maccounts

will return duplicates as comma separated, so a 100 records with 25 values repeated will still return a string with 100 values comma separated.

I guess hard-coding the SELECT statement columns seems only the option to get this achieved.

Thanks again for the explanation and I understand the problem was not an easy one but I am happy in knowing this is something people are experiencing and it is not just my (bad?) programming.

Kind regards
Bhavbhuti



--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer <svein.erling.tysvaer@...> wrote:
>
> Hi again, Bhavbhuti, no-one seems to want to answer your question, so
> I'll answer this one as well...