From: Joseph Shraibman <jks@selectacast.net>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: exists
Date: Mon, 20 Aug 2001 22:05:40 -0400
Message-ID: <3B81C1F4.7080508@selectacast.net> (raw)
I want to select a boolean if there exists a row in another table that matches this one.
So I did select ..., (select count(*) from table2 where ...) > 0 ...
but that count(*) was taking forever. I know there is a better way to do it, but whenever
I try to use EXISTS I get a syntax error. What is the proper way?
--
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio. http://www.targabot.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jks@selectacast.net
Subject: Re: exists
In-Reply-To: <3B81C1F4.7080508@selectacast.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox