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

如何使用子查询与相同的文档update编号empty dategreatest date

最好的问候伊萨姆

4

1 回答 1

0
Update mytable one
set one.date = (select max(date) from mytable two where two.docNumber = one.docNumber)
where one.date is null
于 2015-02-07T10:47:12.703 回答