NeuroDegenerative Problem in SQL
-
Hi everybody i have two tables that have Many-to-many relationship (personality-to-(Personality_PersonalitySubtypes)-PersonalitySubtypes) in normal scenarioes , u would select all personalitySubtypes by knowing only the personalityID by inner join the three tables but suppose that i need the reverse case , i need to select the personalityID by knowing the four combinations of personalitysubtypes knowing that i need it to be completely accurate means if one of the four combination changes the whole personalityID may be changed . how could i do that in sql ? i tried data structures in C# to iterate and blah blah blah till my brain is down i don't know what to do
Human knowledge belongs to the world.
-
Hi everybody i have two tables that have Many-to-many relationship (personality-to-(Personality_PersonalitySubtypes)-PersonalitySubtypes) in normal scenarioes , u would select all personalitySubtypes by knowing only the personalityID by inner join the three tables but suppose that i need the reverse case , i need to select the personalityID by knowing the four combinations of personalitysubtypes knowing that i need it to be completely accurate means if one of the four combination changes the whole personalityID may be changed . how could i do that in sql ? i tried data structures in C# to iterate and blah blah blah till my brain is down i don't know what to do
Human knowledge belongs to the world.
You can use the same data/query structure but instead of filtering on where
personalityid = 2
you can usewhere personalitysubtype in (14,1,78)
. Have a look in WHERE IN in BOL.Never underestimate the power of human stupidity RAH