58.1.6 Query Tutorial: Cross Relational Query
Sometimes we want to find a selection of records for a Table based on the values of records in another Table. This is called a Cross Relational Query. For instance:
QUERY [Location] AND [HospitalRecord]Demog_Last_Name #Jones
Notice that the Master Table and the Field Table are not the same. We can do this because the [Location] table has a relationship with the [HospitalRecord] table and the [Hospital Record] table is to the left of the [Location] table in the Relations diagram Query Tutorial: Relationships between Tables on page 455.
Now if we try the reverse of this:
QUERY [HospitalRecord] AND [Location]Demog_Last_Name #Jones
At first it may seem that we have a wrong result. But we are now returning [HospitalRecord] Table records. Because there can be many [Location] records for each [HospitalRecord] record, we get a much smaller result.
|