exists - Mailing list pgsql-sql

From Joseph Shraibman
Subject exists
Date
Msg-id 3B81C1F4.7080508@selectacast.net
Whole thread Raw
Responses Re: exists  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Simple SQL-syntax
Next
From: Carolyn Lu Wong
Date:
Subject: database location question