Thomas Lockhart <lockhart@alumni.caltech.edu> said: 

> > I think I asked this before but don't recall seeing an answer.  Do we
> > have a logical AND?
> 
> Uh, yes. It's called "AND" ;)

That's what I was afraid of.

    ERROR:  left-hand side of AND is type 'int4', not bool


Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
128K ISDN - $24.95/mo or less; 56K Dialup - $17.95/mo or less www.pop4.net
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================





Wed, 15 Dec 1999 11:00:43 -0500 (EST)
Vince Vielhaber <vev@michvhf.com>
Re: [HACKERS] AND &&
At 11:00 AM 12/15/99 -0500, Vince Vielhaber wrote:
>Thomas Lockhart <lockhart@alumni.caltech.edu> said: 
>
>> > I think I asked this before but don't recall seeing an answer.  Do we
>> > have a logical AND?
>> 
>> Uh, yes. It's called "AND" ;)
>
>That's what I was afraid of.
>
>    ERROR:  left-hand side of AND is type 'int4', not bool

>SELECT (( sum(case dict.word when 'enable' then 1 else 0 end) && sum(case
>dict.word when 'test'  then 1 else 0 end)))

try something like

select ((sum(case dict.work when 'enable' then 1 else 0 end) > 0 and
         sum(case dict.word when 'test' then 1 else 0 end) > 0))

or perhaps rewrite the query to use "exists"???  That appears to be the
point of this snippet.

Apparently mySQL is misnamed.  Perhaps it should be renamed myC-ishQL.



- Don Baccus, Portland OR <dhogaza@pacifier.com>
  Nature photos, on-line guides, Pacific Northwest
  Rare Bird Alert Service and other goodies at
  http://donb.photo.net.

Wed, 15 Dec 1999 08:27:36 -0800
Don Baccus <dhogaza@pacifier.com>
Re: [HACKERS] AND &&
Vince Vielhaber <vev@michvhf.com> writes:
>> Uh, yes. It's called "AND" ;)

> That's what I was afraid of.

>     ERROR:  left-hand side of AND is type 'int4', not bool

1 => 't'::bool, etc.

			regards, tom lane

Wed, 15 Dec 1999 12:22:51 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] AND && 
I wrote:
> 1 => 't'::bool, etc.

Er, ignore that ... I missed the sum() operator.  Don Baccus has
more reasonable comments ...

			regards, tom lane

Wed, 15 Dec 1999 12:27:41 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] AND && 