I have a many-to-many relationship in my database. Each Job can be related to many facilities and each facility can be related to many different jobs. I have a "Job" table, a "Facility" table and a "JobFacility" table that keeps track of these relationships.
For example, I have job #1 which is related to Anderson Boilers and Pelzer Refineries.
I want to create a report that will list all of the jobs and various information. I want the report to display the first facility that the job is related to and to disregard all the other facilities. (The reason being that most of the time each job will have one facility, but every once in a while one job will have 4+ facilities and we want the report to be consistent.)
Does anyone know how I can structure my query so that I just pull out the first value? Does this make any sense?
For example, I have job #1 which is related to Anderson Boilers and Pelzer Refineries.
I want to create a report that will list all of the jobs and various information. I want the report to display the first facility that the job is related to and to disregard all the other facilities. (The reason being that most of the time each job will have one facility, but every once in a while one job will have 4+ facilities and we want the report to be consistent.)
Does anyone know how I can structure my query so that I just pull out the first value? Does this make any sense?