S
sklett
Hi-
I have 3 tables
Prod_Docs (many-to-many)
[ProdId (fk) ] [DocId(fk) ]
Docs_Main
[DocId(pk)] [CatId(fk)]
Docs_Categories
[CatId(pk)]
I want to select all the records in Docs_Categories that are linked by the
Prod_Docs many-to-many table. I can't figure out how to accomplish this.
Here is more info:
SO let's say there are 10 Docs_Main records in the Prod_Docs table
Assume that there are 500 records in the Docs_Categories table
All I want is to get the Docs_Categories records that are actually being
used AND... I can't have any duplicates. So if 3 of those 10 Docs_Main
records use the same Docs_Categories.. I don't want to get 3 repeating
records. I need to use this in a DataRelation.
Also, in case you are wondering what in the world I'm trying to do... I
want to present my Data like this:
Product Data
Document Category
Document
Document
Document
Document Category
Document
It's kicking my butt, I need to get the data in this weird backwards way to
accomplish this.
If anyone has a better idea that what I'm already trying.. PLEASE share,
because I have several situations like this throughout the site.
Thanks for reading!
-Steve
I have 3 tables
Prod_Docs (many-to-many)
[ProdId (fk) ] [DocId(fk) ]
Docs_Main
[DocId(pk)] [CatId(fk)]
Docs_Categories
[CatId(pk)]
I want to select all the records in Docs_Categories that are linked by the
Prod_Docs many-to-many table. I can't figure out how to accomplish this.
Here is more info:
SO let's say there are 10 Docs_Main records in the Prod_Docs table
Assume that there are 500 records in the Docs_Categories table
All I want is to get the Docs_Categories records that are actually being
used AND... I can't have any duplicates. So if 3 of those 10 Docs_Main
records use the same Docs_Categories.. I don't want to get 3 repeating
records. I need to use this in a DataRelation.
Also, in case you are wondering what in the world I'm trying to do... I
want to present my Data like this:
Product Data
Document Category
Document
Document
Document
Document Category
Document
It's kicking my butt, I need to get the data in this weird backwards way to
accomplish this.
If anyone has a better idea that what I'm already trying.. PLEASE share,
because I have several situations like this throughout the site.
Thanks for reading!
-Steve