update mytable set dept =(select max(dept) from mytable )+1 where ID= (SELECT MIN(ID) FROM MYTABLE WHERE DEPT IS NULL) AND dept is Null
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)