JOIN goodness forever
Date: 04/20/07
(SQL Server) Keywords: sql
My thirst for SQL knowledge continues.
Four tables: ASSIGNMENT, PROFESSION, SPECIALIZATIONS, ASSIGNMENT_TO_SPECIALIZATION
I want to retrieve all assignments and their associated profession and specializations. While each assignment has only 1 profession, it can have multiple specializations. The m-to-m table, ASSIGNMENT_TO_SPECIALIZATION, handles this possibility.
How can I query this so that I get unique assignments returned? Since there is a possibility for multiple specializations wouldn't that return the same assignment multiple times? Would a GROUP BY do it in this case?
Source: http://community.livejournal.com/sqlserver/58413.html