ios Sqlite database - Select query -


i have used following table(emp) in product.

id  - name - manager - dept- ismanager 101 - xxx  - yyy - 1-0 102 - xx   - yy  - 2-0 103 - xxx  - yyy - 1-0 104 - xx   - yy  - 2-0 105 - xxx  - kkk - 2-0 106 - xx   - zzz - 2-0 107 - xxx  - yyy - 2-0 

i want update ismanager column value 1, when manager yyy/yy. because repeatable in table. how can solve it? have tried check condition in "update emp set ismanager = '1' manager = 'yyy' , manager = 'yy'; in case table hit many times , dont know value stored in manger column. change runtime. want know, if 'manager' column value repeated, update 'ismanager' column '1'. please suggest me. how that?

this is, can achieved per cl(below) suggestion. cl.

update emp set ismanager = 1 manager in (select manager                   emp                   group manager                   having count(*) > 1) 

Comments