Link to home
Start Free TrialLog in
Avatar of IUAATech
IUAATech

asked on

join on multiple tables

I have the following two tables in a SQL 2005 database.

people
--------
person_id (PK)
first_name
mid_name
last_name
empl_id

multiple_sources
----------
source
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?
Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi IUAATech;

Are you still have issues with this?

Fernando
Avatar of IUAATech
IUAATech

ASKER

Thanks.
Not a problem, glad to help.  ;=)