SQL SELECT from third level table
- by Spidermain50
Ok I know little about SQL so bare with me...
I'm trying to see if certain values exist in a third level table and I don't know how to go about it. Here is the scenario...
I have a Accident table that holds accident information. It has 3 one-to-many child tables (Units, Occupants, NonMotorists). An each of those child tables have their own many-to-many child table (Alcohol). I need to be able to have some way of seeing if a range of values exists in a field in those Alcohol tables. Here is watered down version of what my structure for the tables looks like...
--tblAccident--_
PK_AccidentNumber
--tblAccidentUnit--
PK_PrimaryKey
FK_AccidentNumber
--tblAccidentOccupant--
PK_PrimaryKey
FK_AccidentNumber
--tblAccidentNonMotorist--
PK_PrimaryKey
FK_AccidentNumber
--tblAccidentUnitAlcohol--
PK_PrimaryKey
FK_ForeignKey
AlcoholValue <---- THIS IS WHAT I NEED TO SEARCH
--tblAccidentOccupantAlcohol--
PK_PrimaryKey
FK_ForeignKey
AlcoholValue <---- THIS IS WHAT I NEED TO SEARCH
--tblAccidentNonMotoristAlcohol--
PK_PrimaryKey
FK_ForeignKey
AlcoholValue <---- THIS IS WHAT I NEED TO SEARCH
I hope this makes some sense as to what i am trying to accomplish. thank you