Subject | Re: [firebird-support] Re: fb 1.0 => 1.5 having doesnt work any more |
---|---|
Author | Arno Brinkman |
Post date | 2003-07-09T07:56:05Z |
Hi Richard,
I'm sorry i didn't read yor message good enough :(
In the HAVING clause you should only contain aggregate-funtions or
expressions that are also part of the GROUP BY clause.
This should be what you want also in FB 1.0 :
SELECT
ZiBelegNr,
Min(SplitDate) as "Splitter-Datum"
FROM
RsvKat
HAVING
Min(SplitDate) IS NOT NULL
GROUP BY
ZiBelegNr
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
I'm sorry i didn't read yor message good enough :(
In the HAVING clause you should only contain aggregate-funtions or
expressions that are also part of the GROUP BY clause.
This should be what you want also in FB 1.0 :
SELECT
ZiBelegNr,
Min(SplitDate) as "Splitter-Datum"
FROM
RsvKat
HAVING
Min(SplitDate) IS NOT NULL
GROUP BY
ZiBelegNr
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> > > in Firebird 1.0 we use this and it works fine:
> > >
> > > Select ZiBelegNr, Min(SplitDate) as "Splitter-Datum" from RsvKat
> > > group by ZiBelegNr
> > > having (SPLITDATE is not null)
> > >
> > > I want those ZiBelegNr entries that have for the "ZiBelegNr" only
> > > entries with Splitdate not null.
> > > e.g.
> > > ZiBelegNr Splitdate
> > > 1 08/08/2003
> > > 1 NULL
> > > 2 08/08/2003
> > > 3 NULL
> > > ZiBelegNr=2 is what i want to get.
> > >
> > > But in fb1.5 it doesnt work (error). I need fb 1.5 for windows
> 2003.
> > > I tried
> > > Select ZiBelegNr, Min(SplitDate) as "Splitter-Datum" from RsvKat
> > > group by ZiBelegNr, splitdate
> > > having (SPLITDATE is not null)
> > >
> > > That SQL works, but i get the wrong result.
> > >
> > > Any Idea what to do
> >
> > You should check "Splitdate" in the where clause.
> >
> > SELECT
> > ZiBelegNr,
> > Min(SplitDate) as "Splitter-Datum"
> > FROM
> > RsvKat
> > WHERE
> > SPLITDATE is not null
> > GROUP BY
> > ZiBelegNr
> >
> >
> >
> > Regards,
> > Arno Brinkman
> > ABVisie
> >
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > Firebird links :
> > http://www.firebirdsql.com
> > http://www.firebirdsql.info
> > http://www.fingerbird.de/
> > http://www.comunidade-firebird.org/
> >
> >
> > Nederlandse firebird nieuwsgroep :
> > news://80.126.130.81
>
> Sorry this doesn't give me the result i want. If id o so i get
> ZiBelegNr Splitdate
> 1 08/08/2003
> 2 08/08/2003
> but i want to get only ZiBelegNr=2.
>
> I think i've to create a view, but im nut amused about it and to have
> such differences between fb 1.0 and fb 1.5. I hope future updates are
> better.
>
> Or is there another wya to get the result i want to have?
>
> best regards
>
> Richard
>
>
>
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>