Jump to content

Need help with a SQL statement in a link table


mike2325

Recommended Posts

Hi,

 

I have a link table with the values Room_Code and Facility_ID from a Room table and a facility table respectively. The Room table contains fields Room_Code, Capacity etc and the Facility table contains Facility_ID and Facility_Type.

 

Therefore the link table for example contains:

 

room code: abc1    Facility_ID:1

room code: abc1    Facility_ID:5

room code: abc1    Facility_ID:6

room code: abc1    Facility_ID:9

room code: jjj1    Facility_ID:1

room code: jjj1    Facility_ID:2

room code: jjj1    Facility_ID:7

room code: jjj1    Facility_ID:9

 

I wanted to write a sql statement so that the user could select a room that has the Facility_IDs 1, 5 and 6 - so as to search for rooms with those facilities.  Any ideas on how to do this as I am confused with searching between the different records.

 

Thanks,

Mike

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.