• Your first query was updating T_VM_QUEUE where STATUS_CD was equal to the value returned by the subquery used in the where clause. The second one is updating only one row because only one row is returned by the CTE. That's a really cool feature of the CTE, and you can use it to perform deletes as well.