Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA10094 for ; Tue, 26 Oct 1999 10:27:51 -0400 (EDT) (envelope-from herouth@oumail.openu.ac.il) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.8/8.8.8) with ESMTP id QAA24675; Tue, 26 Oct 1999 16:27:39 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <199910251943.VAA13984@laokoon.bug.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 26 Oct 1999 16:28:17 +0200 To: guenther@laokoon.IN-Berlin.DE (Christian Guenther), pgsql-sql@hub.org From: Herouth Maoz Subject: Re: [SQL] different between || and && in a statement At 21:43 +0200 on 25/10/1999, Christian Guenther wrote: > Whats the different between the logical expression && and || and is there > a way to get && working? It's really not clear what you are trying to achieve here. Neither || nor && are logical operators. In Postgres, || is string concatenation, not "or". What you would get in sum(...) || sum( ... ) is the concatenation of the two sums. If one is 32 and the other 17, you'd get 3217. In any case, what sense does a logical operator have between two integers? Logical operators should connect between logical operands. But the sums are sums of integers. There is no such thing as a boolean sum. Unless you meant to do a cumulative "or" operation between all the rows that have the proper string value? In that case, you really have to build a custom aggregate for it. In any case, in SQL, the word for "or" is... OR. The word for "and" is AND and the word for "not" is NOT. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma