Hi everybody! I have a question.... I have a database with 2 tables: Adult and Child. The Adult table has the following columns: id_adult(primary key), name, surname. The Child table has the next columns: id_child(primary key), id_adult(foreign key to Adult table), id_adult2(foreign key to Adult table). Ok, now I want to select from the Adult table all the adults which don't have any children. I've tried something like this: SELECT a.id_adult,a.name,a.surname,c.id_adult1,c.id_adult2 from Adult as a left join Child as c on a.id_adult=c.id_adult1 or a.id_adult = c.id_adult2 where c.id_adult1=null or c.id_adult2=null
And the result doesn't show anything. Where I do wrong?monty