posted 20 years ago
Say I have the following data model:
Table A -0..m-> Table B -0..m-> Table C
Doing the sql for this is not hard, just joining tbls A->B and B->C. The problem is, that there are a lot of different Table Bs and Table Cs, and the size of the data returned grows exponentially. The last query of this kind that I ran returned 6+ megabytes, and 90% of which is redundant.
The Question:
Is there a way in SQL to get rid of the redundant data, so it would be like the following
Normally, this wouldn't be a problem - I'd do it programmatically with a loop and lose all the redundancy - however, in this case, my hands are tied:
The only sql queries I can do are "1-step" - so I can't get the results of A->B and use that to get B->C results. I have absolutely no programmatic control over the sql execution.
[ January 05, 2004: Message edited by: Phil Chuang ]