Re: exists - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: exists
Date
Msg-id Pine.BSF.4.21.0108202239210.3144-100000@megazone23.bigpanda.com
Whole thread Raw
In response to exists  (Joseph Shraibman <jks@selectacast.net>)
List pgsql-sql
On Mon, 20 Aug 2001, Joseph Shraibman wrote:

> 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?

Hmm, on current sources I can do:
select ..., exists (select * from table2 where ...) from table1;

I don't know if that's new though...



pgsql-sql by date:

Previous
From: Carolyn Lu Wong
Date:
Subject: database location question
Next
From: Bhuvan A
Date:
Subject: is it possible to use arrays in plpgsql function??