Subject Re: [firebird-support] Query help
Author Ricardo Uzcategui
select DISTINCT m.*
from master m
join detail d
on (m.id = d.master)
where (d.removed is not null)

On Sun, Jul 22, 2012 at 5:21 PM, Kjell Rilbe <kjell.rilbe@...> wrote:

> **
>
>
> Den 2012-07-22 22:35 skrev Ricardo Uzcategui s�h�r:
>
> > Maybe if you do a join...
> >
> > like this...
> >
> > select m.* from master m
> > join detail d
> > on (m.id = d.master)
> > where (d.removed is not null)
>
> Thanks for trying, but that would return all master records where there
> is at least one detail that's not removed. Instead, I need all the
> masters where there are removed details, but no current ("unremoved") ones.
>
>
> Kjell
>
> --
> --------------------------------------
> Kjell Rilbe
> DataDIA AB
> E-post: kjell@...
> Telefon: 08-761 06 55
> Mobil: 0733-44 24 64
>
>
>



--
Ricardo...


[Non-text portions of this message have been removed]