| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Urgent help please
"Alan" <alanpltse_at_yahoo.com.au> wrote in message news:<3f45784a_at_news.comindico.com.au>...
> Candy is not included before she is a child of Alan.
> I only want to include the top level parent.
>
select
x1.name, x1.age
from
x x1, x c
where
x1.age > 20 and x1.parent is null
group by
x1.name, x1.age
having
count(case when c.parent = x1.id and c.age < 20 then 1 else null end) = 0
if "CASE WHEN ..." is not supported by mysql, you could perhaps use "IF ..."? I've seen "IF ..." in Q/A for mysql, so I guess "CASE ..." is not supported? Received on Fri Aug 22 2003 - 01:09:03 CDT
![]() |
![]() |