Re: the best way to get the topest 3 record in every group

From: dima <_pppp(at)mail(dot)ru>
To: jack <datactrl(at)tpg(dot)com(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: the best way to get the topest 3 record in every group
Date: 2002-09-09 06:34:48
Message-ID: 3D7C4108.70407@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> There is a table like :
> <<
> itemNo
> supplier
> purchaseDate
> Price
> Qty
> <<
> Please provide an idea if I want to get the latest 3 puchase records for
> each item and supplier. Thank you in advance.
select * from table_name where supplier=value order by purchaseDate desc
limit 3
???

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Davis 2002-09-09 07:20:03 Cross tables Like%
Previous Message jack 2002-09-09 00:21:30 the best way to get the topest 3 record in every group