Re: split expressions

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jan 13 2010 - 07:19:18 EST

  • Next message: Aristedes Maniatis: "Re: split expressions"

    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



    This archive was generated by hypermail 2.0.0 : Wed Jan 13 2010 - 07:20:12 EST