Re: Select from Java Strings

From: Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Select from Java Strings
Date: 2011-07-04 13:33:49
Message-ID: 86d3hqdvb6.fsf@mgm.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <4E116E11(dot)1030209(at)gmail(dot)com>,
Daron Ryan <daron(dot)ryan(at)gmail(dot)com> writes:

> Hello David,
> This is a simplified version of my own attempt:

> SELECT *
> FROM ("oxford", "webster")
> WHERE NOT ( columnName = ANY (SELECT name FROM dictionaries))

> The idea is that "oxford" and "webster" come from the Java program end up
> in the column called columnName.

If the list is not very long, you could use a VALUES expression:

SELECT g.x
FROM (VALUES ('oxford'), ('webster')) AS g(x)
WHERE g.x NOT IN (SELECT name FROM dictionaries)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Gould 2011-07-04 15:20:17 problems installing odbc and .Net drivers
Previous Message Craig Ringer 2011-07-04 12:46:19 Re: When the Session ends in PGSQL?