Subject Re: Distinct on one column only? How?
Author Svein Erling Tysvær
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