So I have a table that looks like this:
ProjectID TaskID Date 000 001 10/28/09 000 002 12/1/09 000 003 02/24/10 001 001 04/14/10 001 002 07/5/10 001 003 02/24/11 002 001 06/07/10 002 002 07/7/10 002 003 09/13/12
Assume there are many projects and many tasks, but each project contains the same tasks. I want to copy dates in the following manner:
One project (000) has the master dates. I want to copy those dates for each task to several other projects (001, 002 in the example data).
So, if task 001 in project 000 has a date of 10/28/09, I want task 001 in other projects (I know their IDs) to have the same date.
If task 002 in project 001 has date 12/1/09, I want task 002 to have this date in each of the other projects as well.
Is there one query that can do this? I think there should be, but I can't figure it out right now.
BTW I am using SqlServer 2005.