Link to home
Start Free TrialLog in
Avatar of Mark1M
Mark1MFlag for United States of America

asked on

Setting a field value when multiple records exist

Hi Everyone,

I have a question on how to set a field value in multiple records where there is a specific key, when a  condition is meet within multiple records.

I have a table 'A', it contains 4 fields:
TEAM_NAME
PLAYER_NAME
PLAYER_STATUS
TEAM_STATUS

I will have multiple records with the same TEAM_NAME(key). I want to set the TEAM_STATUS to 'Y' in each team record, only when ALL of the individual PLAYER_STATUS for that team is 'Y'.

Thanks in advance.

Mark
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
momi_sabag's answer is appropriate for your current table definition, but generally speaking your data model does not seem adequate for the requirements. You clearly have two entities: team and player, which asks for at least two separate tables.
Avatar of Mark1M

ASKER

momi_sabag & mustaccio,

Thank you very much for your responses.