如何从MS-Access中的相同字段更新SQL字段

时间:2015-02-07 10:38:06

标签: sql ms-access sql-update subquery sql-in

 - **Date          | DocNumber**
 - ------          | 5000001
 - ------          | 5000001
 - ------          | 5000001
 - 28/02/2014      | 5000001
 - 28/02/2014      | 5000001
 - 31/12/2013      | 5000001

如何update empty date greatest date使用{{1}}使用子查询获取相同文档编号

祝你好运 埃萨姆

1 个答案:

答案 0 :(得分:0)

Update mytable one
set one.date = (select max(date) from mytable two where two.docNumber = one.docNumber)
where one.date is null