Received: from p1.selectacast.net (p1.selectacast.net [64.15.230.162]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7L25iP30605 for ; Mon, 20 Aug 2001 22:05:44 -0400 (EDT) (envelope-from jks@selectacast.net) Received: from selectacast.net (IDENT:jks@d1 [64.7.9.58]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id WAA31695 for ; Mon, 20 Aug 2001 22:05:41 -0400 Message-ID: <3B81C1F4.7080508@selectacast.net> Date: Mon, 20 Aug 2001 22:05:40 -0400 From: Joseph Shraibman Organization: Xtenit, Inc. http://www.xtenit.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql Subject: exists Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200108/256 X-Sequence-Number: 4503 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