June 13, 2008 at 6:51 am
I need to create a view with N to N relationship tables.
I have these tables:
Tab Category:
IDCategory
Title
Tab SubCategory:
IDSubCategory
Title
Tab SubCatRelationship:
IDSubCatRelationship
IDSubCategory
IDCategory
How do i do that?
please, help! thanks in advance!
June 13, 2008 at 9:51 am
I can't quite see what you're looking to accomplish. "N to N relationship" could mean a lot of different things to different people. Can you provide a real-world example of an entity for each table and how that entity would relate to the other tables? Without more concrete detail, I'm not sure what it is you want to achieve. Please also provide sample data and the expected result the sample data would generate.
Steve
(aka smunson)
:):):)
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
June 16, 2008 at 5:22 am
I mean many to many relationship.
June 16, 2008 at 7:21 am
Ok, but how about an example of the nature of the relationships? There are far too many ways to put together many-to-many relationships to know what's going to be the best solution for your particular situation. Describe how an entry in each table would relate to entries in the other tables, and describe the real-world entity each table entry is intended to represent. If there are specific limitations on how the various entities relate, that's critical information as well.
Steve
(aka smunson)
:):):)
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
June 16, 2008 at 7:34 am
I can't help but think that you're "overthinking" the problem. There's nothing special about expressing a query that happens to have a many to many. Just join the tables appropriately, and it there's a many to many, the data will show that quite clearly.
Just try to express the joins in a view, and if you get stuck - post what you've tried so far. This kind of smells like homework, so I'm not going to volunteer a solution quite yet.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
June 16, 2008 at 10:22 am
Agreed...
If you simply want to return the titles, its a simple case of joining via ID and returning the fields from the tables, regardless of the many to many relationship
~PD
June 16, 2008 at 10:35 am
Do you have more information on what you're trying to achieve? Honestly this sounds like a test question, and I'd like to see you have produced some DDL or sample data to explain what you're doing.
June 16, 2008 at 10:46 am
I suspect that the OP has abandoned this thread 😉
* Noel
June 17, 2008 at 4:00 pm
Sorry, I didn't left the thread, the problem is that my View has a lot of things that i need to mention here, so i will update it when i have the time to do it... in one or 2 days, i believe
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply