sql update subquery in where clause