Saturday, April 20, 2013

[SQL Server] Replace column data with column data of another table

[SQL Server] Replace column data with column data of another table


Replace column data with column data of another table

Posted: 19 Apr 2013 11:27 PM PDT

I have Two tables as followsTable A:Empid WeekoffDate1000 2012-04-07 00:00:00.0001000 2012-05-17 00:00:00.0001000 2012-06-07 00:00:00.000Table B:Empid WeekoffChangeDate WeekoffDate1000 2012-05-15 00:00:00.000 2012-05-17 00:00:00.0001000 2012-06-13 00:00:00.000 2012-06-07 00:00:00.000Result Table:Empid ActualWeekOffDate1000 2012-04-07 00:00:00.0001000 2012-05-15 00:00:00.0001000 2012-06-13 00:00:00.000I need the above result table, I had tried joins and union all but did not get the result.Thanks in advance.

No comments:

Post a Comment

Search This Blog