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

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -