Subject Re: [firebird-support] Distinct on one column only? How?
Author Martijn Tonies
> 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?

Don't select the "web_order" column.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com