cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: split expressions
Date Wed, 13 Jan 2010 12:19:18 GMT

On Jan 13, 2010, at 2:14 PM, Andrus Adamchik wrote:

>
> On Jan 13, 2010, at 2:02 PM, Andrus Adamchik wrote:
>
>>
>> paintings.exhibits.start > $date1 AND paintings.exhibits.name like  
>> 'X%'
>> OR
>> paintings.exhibits.start < $date2 AND paintings.exhibits.name like  
>> 'Y%'
>> OR
>> paintings.exhibits.start = $date3 AND paintings.exhibits.name like  
>> 'Z%'
>>
>> here you can't describe the desired behavior with "|", but can with  
>> aliases:
>>
>> a.start > $date1 AND a.name like 'X%'
>> OR
>> b.start < $date2 AND b.name like 'Y%'
>> OR
>> c.start = $date3 AND c.name like 'Z%'
>
> Wonder if that's a bad example though, as the intended result can be  
> obtained without splits... Need to think of a better one. Although  
> the idea is that there can be cases when exact control over joins is  
> needed.
>
> Andrus

How about this (looking for artists that have multiple paintings with  
multiple exhibits, each matching its own set of criteria) :

  a.start > $date1 AND a.name like 'X%'
AND
  b.start < $date2 AND b.name like 'Y%'
AND
  c.start = $date3 AND c.name like 'Z%'

Andrus


Mime
View raw message