Subject Re: fb 1.0 => 1.5 having doesnt work any more
Author Richard
--- In firebird-support@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@k...> wrote:
> At 14:37 08.07.2003 +0000, you wrote:
> >Select ZiBelegNr, Min(SplitDate) as "Splitter-Datum" from RsvKat
> >group by ZiBelegNr, splitdate
> >having (SPLITDATE is not null)
>
> Try
>
> Select distinct ZiBelegNr, SplitDate as "Splitter-Datum"
> from RsvKat k1
> where not exists(
> Select * from RsvKat k2
> where k1.ziBelegNr = k2.ziBelegNr and
> (k2.splitdate < k1.splitdate or k2.splitdate is null)
>
> Your original query doesn't make any sense since you group by a
field that
> you also use an aggregate function upon.
>
> HTH,
> Set

Thanks. It works. But it takes a little longer 0050 ms (having sql)
0090 ms (exists sql). In my case its not bad, because this table is
not so large.

regards Richard