Re: Q: select query

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: "G(dot) Ralph Kuntz, MD" <grk(at)usa(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Q: select query
Date: 2003-09-13 18:17:16
Message-ID: 1063477035.66715.7.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> in other words, all but the first row of a group.

Interesting question. The below should work and be quick so long as
there is a UNIQUE(col1, col2) constraint.

SELECT col1
, col2
FROM j
WHERE col2 != (SELECT col2
FROM j AS jsub
WHERE col1 = j.col1
ORDER BY col2 ASC
LIMIT 1);

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Miko O'Sullivan 2003-09-13 18:23:36 Re: [BUGS] session variable
Previous Message chester c young 2003-09-13 18:10:04 production parameters