join on multiple tables
Posted on 2009-07-06
I have the following two tables in a SQL 2005 database.
person_id (This is a FK to people.person_id)
Here is what I want to accomplish;
Write a script (using C# and LINQ) to identify all the records in the people table having the same empl_id - basically a "group by on empl_id having count(empl_id) > 1". The output needs to contain all the columns in the people table. Now, I also need to (left) join the people table with the multiple_sources table and exclude all the person_id's that have multiple_sources.source of either a "D" or a "Z".
I want to schedule to script to run once a week and forward the output to a group of people in my organization for data cleanup.
Can someone please help me get started?