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

« More JOIN inquiries || SQL 2005 Classes »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home