Re: Tricky SQL question

From: Crle <crle_at_nebo.org>
Date: Tue, 27 Mar 2001 09:44:24 +0200
Message-ID: <99pg6i$2fii$1_at_as121.tel.hr>


"A&B" <cassandra_sharpe_at_merck.com> wrote in message news:99bb96$ktt$1_at_merck.com...
> I need to create a sql statement that select a specific number of records
> from a table for each unique value within a column.
>
> For example.... I have a table that stores news articles. Every news
> article has a type( headlines, health, comics, etc ). I need to select
 two
> news articles from the table for every news type. If there are 10 unique
> news types in the table, then I need to select two records for every type
 in
> the table.

If you need just two articles , group it by type and select min(article) and than union with max (article) Received on Tue Mar 27 2001 - 09:44:24 CEST

Original text of this message