Re: SQL WHERE: many sql or large IN()

From: Listmail <lists(at)peufeu(dot)com>
To: tom <tom(at)tacocat(dot)net>, Postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL WHERE: many sql or large IN()
Date: 2007-04-06 19:02:59
Message-ID: op.tqdlu9xszcizji@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> I've never seen this before.
> Is this PG specific or generic SQL that I've never been exposed to?

http://www.postgresql.org/docs/8.2/interactive/sql-values.html
VALUES conforms to the SQL standard, except that LIMIT and OFFSET are
PostgreSQL extensions.

It doesn't seem like much at first glance, but it's really useful. It's
your kleenex temp table. It can select the rows you want from a table in
the order you want, update a table, replacing several values with several
others (as a before=>after correspondence table) and many other things. It
is more powerful than IN() because you can use columns of the VALUES() in
any part of your query, updating, ordering, etc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-04-06 19:33:48 Re: SQL WHERE: many sql or large IN()
Previous Message tom 2007-04-06 18:28:32 Re: SQL WHERE: many sql or large IN()