Hello
I have been using SQL for a number of years, but I am struggling with an intermediate query. I want a record to be displayed as below
1 Ademola Adebayo 4 Women @ West Street Member
2 Christine Adebayo 4 Women @ West Street Leader
when I run the following query
select `mu`.`id` AS `id`,`mu`.`firstname` AS `firstname`,`mu`.`lastname` AS `lastname`,`mu`.`memberTypeID` AS `memberTypeId`,`mm`.`name` AS `MinistryName`,`mmr`.`name` AS `RoleName` from (((`members_users` `mu` left join `members_ministryParticipant` `mmp` on((`mu`.`id` = `mmp`.`membersID`))) left join `members_Ministry` `mm` on((`mm`.`id` = `mmp`.`ministryID`))) left join `members_Ministry_Role` `mmr` on((`mmr`.`id` = `mmp`.`roleID`))) where (`mu`.`memberTypeID` > 1) and mm.name = 'Women @ West Street '
union
select `mu`.`id` AS `id`,`mu`.`firstname` AS `firstname`,`mu`.`lastname` AS `lastname`,`mu`.`memberTypeID` AS `memberTypeId`,`mm`.`name` AS `MinistryName`,`mmr`.`name` AS `RoleName` from (((`members_users` `mu` left join `members_ministryParticipant` `mmp` on((`mu`.`id` = `mmp`.`membersID`))) left join `members_Ministry` `mm` on((`mm`.`id` = `mmp`.`ministryID`))) left join `members_Ministry_Role` `mmr` on((`mmr`.`id` = `mmp`.`roleID`))) where (`mu`.`memberTypeID` > 1)
and mm.name = 'Women @ West Street' or mu.id in (select `mu`.`id` AS `id` from (((`members_users` `mu` left join `members_ministryParticipant` `mmp` on((`mu`.`id` = `mmp`.`membersID`))) left join `members_Ministry` `mm` on((`mm`.`id` = `mmp`.`ministryID`))) left join `members_Ministry_Role` `mmr` on((`mmr`.`id` = `mmp`.`roleID`))))
But what the above query returns is this
1 Ademola Adebayo 4 Women @ West Street Member
1 Ademola Adebayo 4 Mothers and Toddlers Member
2 Christine Adebayo 4 Women @ West Street Leader
Please can any one tell me how to eliminate the second row?