![]() |
| |||
| I have one-to-many relationship Manager ->> Employee , tables are already created (40'000 items) Manager Employee id id data11 data21 data12 data22 ... .. manager_id as I need to keep the count of the number of managed employeed in the Manager Table I created a new column in the Manager table Manager id data11 data12 ... employees_count and I would like to update directly the table Manager from the terminal (using mysql), I know how to modiffy one record, but I don't know how to do that for all managers ... how should I proceed.. thanks joss |
| |||
| Josselin wrote: > I have one-to-many relationship Manager ->> Employee , tables are > already created (40'000 items) > > Manager Employee > id id > data11 data21 > data12 data22 > .. .. > manager_id > > as I need to keep the count of the number of managed employeed in the > Manager Table > I created a new column in the Manager table > > Manager > id > data11 > data12 > .. > employees_count > > and I would like to update directly the table Manager from the terminal > (using mysql), > I know how to modiffy one record, but I don't know how to do that for > all managers ... > how should I proceed.. > > thanks > > joss Don't. Don't duplicate info in the database that can be calculated from other info in the database. Just recalculate as when required. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |