Received: from frosch.all.de (mail.beehive.de [212.21.71.35]) by hub.org (8.9.3/8.9.3) with ESMTP id PAA44156 for ; Mon, 25 Oct 1999 15:44:16 -0400 (EDT) (envelope-from guenther@laokoon.IN-Berlin.DE) Received: by mail.beehive.de (8.9.3/nora-19990817) with UUCP for pgsql-sql@hub.org (envelope-from guenther@laokoon.IN-Berlin.DE) id VAA01518; Mon, 25 Oct 1999 21:44:15 +0200 (CEST) Received: (from guenther@localhost) by laokoon.bug.net (8.9.3/8.9.3) id VAA13984 for pgsql-sql@hub.org; Mon, 25 Oct 1999 21:43:15 +0200 Message-Id: <199910251943.VAA13984@laokoon.bug.net> Subject: different between || and && in a statement To: pgsql-sql@hub.org Date: Mon, 25 Oct 1999 21:43:15 +0200 (CEST) X-Charset: ISO-8859-1 From: guenther@laokoon.IN-Berlin.DE (Christian Guenther) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, I hope theis is the last question for the next time: 1st statement: SELECT (sum(case when dict.word = 'museum' then 1 else 0 end) && sum(case when dict.word = 'immer' then 1 else 0 end)) as qu , dict.url_id ^^ FROM dict, url WHERE url.rec_id = dict.url_id AND url.url LIKE '%%' AND dict.word in ('museum','immer') GROUP BY dict.url_id HAVING sum(case when dict.word = 'museum' then 1 else 0 end) && sum(case when dict.word = 'immer' then 1 else 0 end) > 0 ^^ The result is: ERROR: Unable to identify an operator '&&' for types 'int4' and 'int4' You will have to retype this query using an explicit cast but if a do it with : SELECT (sum(case when dict.word = 'museum' then 1 else 0 end) || sum(case when dict.word = 'immer' then 1 else 0 end)) as qu , dict.url_id ^^ FROM dict, url WHERE url.rec_id = dict.url_id AND url.url LIKE '%%' AND dict.word in ('museum','immer') GROUP BY dict.url_id HAVING sum(case when dict.word = 'museum' then 1 else 0 end) || sum(case when dict.word = 'immer' then 1 else 0 end) > 0 ^^ .... all is OK Whats the different between the logical expression && and || and is there a way to get && working? Thanks for any hints. I hope the isn't a stupid question. Christian -- Christian Guenther Kunsthistoriker Fax: +49 030 4464152 E-mail: cg@kunst-und-kultur.de Tel: +49 030 4442931 http://kunst-und-kultur.de/ Museen, Kuenstler, Ausstellungen, Kunstprojekte ....