Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find common values in all records
Message
 
 
To
21/02/2001 18:21:08
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00478217
Message ID:
00478223
Views:
20
>I have a table that joins providers, services and counties (what services in which county are given by a provider). The table has multiple entries per provider and has foreign keys for the provider, service and county. I need to populate a combo box with the services that a selected provider provides in ALL counties (which the provider is in). In other words, which services are common to every county for the provider.
>
>Does anyone have any ideas?

I am going to call your join table TableX. Does the following work for you?
select services.descript, county.county_name, services.Keyid ;
   from services ;
      join TableX ;
         on services.keyid = TableX.Services_ID
      join Counties ;
         on Tablex.County_ID = County.KeyID ;
   where TableX.Provider_ID = ?nProvider_ID ;
   order by ...
If not, some sample data from all 4 tables would be helpful.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform