Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. NeuroDegenerative Problem in SQL

NeuroDegenerative Problem in SQL

Scheduled Pinned Locked Moved Database
csharpdatabasehelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    snouto
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • S snouto

      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.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      You can use the same data/query structure but instead of filtering on where personalityid = 2 you can use where personalitysubtype in (14,1,78). Have a look in WHERE IN in BOL.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups