[ic] searching for this or that and the_other

Mike Heins mikeh@minivend.com
Sun, 6 May 2001 11:20:00 -0400


Quoting Doug Alcorn (doug@lathi.net):
> The way MySQL interprets it, I can do
> 
> select code from products where addl_category like something or
> addl_category = 'something else' and category = 'another';
> 
> this is the same as ({(a =~ /something/) or (b = 'something else)) and
> (c = 'another')).  i can't seem to get this to work in IC.  here's my
> sameple little test page:
> 
> [set dka_model]NOK6100[/set]
> [seti addlcat_profile]
> sf=addl_category
> op=rm
> se=[scratch dka_model]
> os=yes
> sf=addl_category
> se=universal
> [/seti]
> [bounce href="[area href=|scan| arg=|
>   fi=products
>   st=db
>   sp=results2
>   mp=addlcat_profile
>   os=no
>   sf=category
>   se=Cases
>  |
> ]"]
> 
> The above works fine as long as i leave out the
> os=yes/sf=addl_category/se=universal.  When I put it in, the search
> says that there is nothing that matches.  mathematically, shouldn't
> the return set always be larger with an ORed clause?

Not when you have conflicting os=no and os=yes. Unless it is a coordinated
search, the first setting takes.

-- 
Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>

"Laughter is inner jogging." -- Norman Cousins