Master/Details Complicated SELECT
Posted on 2007-07-31
Ive got two tables which have the following names and fields:
1 The master table has the title of the news (head) and the details table has the body of the news (text).
2 Master table and details table link via a double key field which are [time] & [language_ikey].
3 The corresponding text in the details table is not in one row, it is spitted into multiple rows. The [text] field in these rows corresponding to the master table is to be selected and concatenated by sequence of the [TRow].
4 [TRow] has the index value of which you may select the the news detail multiple rows and ordered by its value to get the proper sentences at the end.
5 The fields [RowsA] or [RowsE] according to the specified language, have the total count of the rows in the corresponding details table.
What I need to do is: to select the news which is completed and display them in one piece; [news title] and [news body]. This takes a check on the maximum value of the [RowsA,E] field and compare it with the [TRow] field, and when they match then the news is complete.
This is a bit tough one. Thanks in advance to all.