Subject | Re: Distinct on one column only? How? |
---|---|
Author | acegracely |
Post date | 2005-05-18T09:03:24Z |
Thank you very much.
Regards
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
Regards
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
> select category, min(web_order)
> from maststockitems
> group by category
>
> Welcome to Firebird!
> Set
>
> --- In firebird-support@yahoogroups.com, "acegracely" wrote:
> > Hi,
> >
> > I have the following statement.
> >
> > select distinct category, web_order from maststockitems
> >
> > When I run it I get the following:
> >
> > LETTERHEADS 1
> > LETTERHEADS 2
> > LETTERHEADS 3
> > ENVELOPES 1
> > ENVELOPES 2
> >
> > What I actually want is one row for each category regardless of
> > whether the web order field has changed.
> >
> > The documentation says that the distinct clause is applied to every
> > column in the select statement.
> >
> > How can I acheive one row per category?
> >
> > Thanks