exists

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: exists
Date: 2001-08-21 02:05:40
Message-ID: 3B81C1F4.7080508@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)selectacast(dot)net
Increase signal to noise ratio. http://www.targabot.com

Responses

  • Re: exists at 2001-08-21 05:40:54 from Stephan Szabo

Browse pgsql-sql by date

  From Date Subject
Next Message Carolyn Lu Wong 2001-08-21 05:19:39 database location question
Previous Message Josh Berkus 2001-08-20 23:44:55 Re: Simple SQL-syntax