I need to retrieve the most recent prices per products from a price list table:
CREATE TABLE listini_anagrafici
(
id character varying(36) NOT NULL,
articolo character varying(18),
listino character varying(5),
data_ent date,
data_fin date,
prezzo double precision,
ultimo boolean DE
Subject: Re: [PERFORM] Performance problems with DISTINCT ON
Sgarbossa Domenico wrote:
I need to retrieve the most recent prices per products from a price list
table:
select distinct on (articolo) articolo,data_ent,prezzo from
listini_anagrafici order by articolo, data_ent desc
but it
I need to retrieve the most recent prices per products from a price list table:
CREATE TABLE listini_anagrafici
(
id character varying(36) NOT NULL,
articolo character varying(18),
listino character varying(5),
data_ent date,
data_fin date,
prezzo double precision,
ultimo boolean DE