i have team member table and team table.
In team member table have , three columns are there teamid, staff_id and stafftype(leader or technician). Only one leader (staff_type column value) will comes in one team. So when i insert data to team member table i need to check whether any leader is there in same team.
How to show an error message that “already have leader in this team”?
team_id staff_id stafftype 1 2 leader 2 1 other 3 8 other 1 5 Technician 2 3 Other 1 4 Leader //This should not come. becoz already teamid-1 have Leader When trying to save from frond end, need to show error message ie;"already have leader in this team"