making queries more effecient

From: "Peter T(dot) Brown" <peter(at)memeticsystems(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: making queries more effecient
Date: 2002-11-01 22:24:52
Message-ID: 1036189492.2013.16.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2002-11-01 22:30:54 Re: Subtracting time fields
Previous Message Robert Treat 2002-11-01 22:12:50 Re: HA PostgreSQL