how to update all rows of a specified data group in SQL server based on a condition? -
i have data:

i need update "isconsiderednewhire" column if there 0 in control group related it, other rows control group should zero.
after update, you'd this:

i'm having hard time figuring out how accomplished.
anyone want give me hand?
you can this:
update mytable set isconsiderednewhire = 0 controlgroupid in (select distinct controlgroupid mytable isconsiderednewhire=0)
Comments
Post a Comment