>I've a db containing two tables which every item in table one is linked [sic] to 1--200 items in table 2. <<
In RDBMS we have references; links is a concept from older network
databases.
Quote:
Quote:
> I want to generate a report like this:
Item in table 1
---------------------------------------
1st-related Item in table2
2nd related Item in table2 <<
Another conceptual error! Tables have no ordering, so ordinal
numbering makes no sense. That is from file systems or network
databases.
Quote:
Quote:
> I've generated a third table with a text-column to hold the report text. Using an small procedure, .. <<
The purpose of SQL is to return data. Period. It is not for
formatting it for display. You are still writing COBOL programs in
RDBMS. This is why we have report writers and front end
applications.
Quote:
Quote:
>the third table contains a single ID field [sic: columns are not fields] which is a unique index. <<
An index is not exposed to the user; did you mimic a sequential file
by using some silly auto-numbering scheme? There is no such thing as
a magical, universal "id" data element in a correct data model; each
identifier is for a *particular* kind of entity.
Please stop writing 1950's COBOL in SQL. What you have done is take
an automobile and hitched your old horse to it.