making queries more effecient - Mailing list pgsql-sql

From Peter T. Brown
Subject making queries more effecient
Date
Msg-id 1036189492.2013.16.camel@localhost.localdomain
Whole thread Raw
Responses Re: making queries more effecient
List pgsql-sql
Hi. I have this query that I have been trying to reduce to a single
statement, but haven't figured out how. Am I missing something?

CREATE TEMP TABLE temp20561149207391 AS SELECT DISTINCT ON ("VisitorID")
"VisitorID","Type" FROM "ProgramEvent" WHERE "ProgramID" = 10 ORDER BY
"VisitorID","Created" DESC;INSERT INTO "VisitorPointer839" ("VisitorID")
SELECT temp20561149207391."VisitorID" FROM temp20561149207391  WHERE
temp20561149207391."Type" = 0


Thanks



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: FIFO Queue Problems
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: unnecessary updates