I have a members DB with a number of smaller tables dividing the members table into groups. I am trying to create a view for each group so as to provide the group leader with missing contact details
I have written a query as below:
CREATE VIEW `missinfo` AS
SELECT a.ID, a.forename, a.surname, b.street, c.phone, c.mobile, c.email
FROM groupfive a, addresses b, contacts c
WHERE a.ID IS NOT NULL
AND b.street IS NULL OR c.Phone IS NULL OR c.mobile IS NULL OR c.Email IS NULL;
It runs but produces 3,000 lines giving the same incorrect details for each person over and over again. It fills the contact details with the same data from members who are not in the group.
Where am I going wrong please?