SQL Server将AM与PM进行比较

时间:2012-11-30 17:09:36

标签: sql-server-2008

我想比较datetime

表1

ID  door    datetime
1   door1   2011-12-12 23:02
2   door1   2011-11-11 20:52 
3   door2   2011-12-13 19:17 

表2

ID  door    datetime
1   door2   2011-12-12 02:02
2   door3   2011-11-11 01:52 
3   door4   2011-12-13 20:17 
4   door2   2012-12-09 11:10
5   door2   2012-12-11 23:54

我想通过比较table2table1

来更新/覆盖id的行与datetime的行

最终结果

表2

ID  door    datetime
1   door1   2011-12-12 23:02
2   door1   2011-11-11 20:52 
3   door2   2011-12-13 19:17 
4   door2   2012-12-09 11:10
5   door2   2012-12-11 23:54

提前感谢您的帮助

0 个答案:

没有答案