sample:
Q: how does this query work?
is system firstly get the list which falg is 'Y', then pick up each id and check if it's in the list, then update accordingly?
Or
is system pick up one id and get the list which flag is 'Y' everytime, then update accordingly?
Code:
update tableA
set flag = 'N'
where id not in
(select id
from tableA
where flag = 'Y')
is system firstly get the list which falg is 'Y', then pick up each id and check if it's in the list, then update accordingly?
Or
is system pick up one id and get the list which flag is 'Y' everytime, then update accordingly?
Comment