Urgent help please
From: Alan <alanpltse_at_yahoo.com.au>
Date: Tue, 19 Aug 2003 06:54:13 GMT
Message-ID: <3f41c994$1_at_news.comindico.com.au>
I have a table contains parent and children information, this is not the actual table that I am working with but has similar structure:
Date: Tue, 19 Aug 2003 06:54:13 GMT
Message-ID: <3f41c994$1_at_news.comindico.com.au>
I have a table contains parent and children information, this is not the actual table that I am working with but has similar structure:
John, age of 50, is the parent of 3 children, Mary, Peter and David.
Alan, age of 60 has 1 child, Candy.
Boby has no children.
Vincent has no children.
I am using MySQL so does not support subquery.
How do I get the names of the parent when satifiy one of the following
conditions:
1) is over 20 years old and have no children
2) is over 20 years old and if his children who are ALL over 20 years old.
Result of the above table:
ID Name Age
5 Alan 60
7 Bobby 35
John is not included because he has child Peter who is 19. Vincent is a parent who is only 18 so also excluded. Received on Tue Aug 19 2003 - 08:54:13 CEST