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

From: "jack" <datactrl(at)tpg(dot)com(dot)au>
To: "dima" <_pppp(at)mail(dot)ru>
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 08:08:21
Message-ID: 000701c257d8$1163c9a0$1400a8c0@jac
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dima
My question is that I want to produce ALL the lastest 3 records for EACH
itemNo and supplier.

Jack
----- Original Message -----
From: "dima" <_pppp(at)mail(dot)ru>
To: "jack" <datactrl(at)tpg(dot)com(dot)au>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Monday, September 09, 2002 4:34 PM
Subject: Re: [SQL] the best way to get the topest 3 record in every group

> > 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 Jay 2002-09-09 08:58:04 Database joins
Previous Message Troy 2002-09-09 07:47:49 Re: Character translation?