On Fri, 2007-05-04 at 15:11 +0200, "Dieter Späth" wrote: > > > Wouldn't it be easier with: > > SELECT * > FROM EVENTS t1 > WHERE t1.event_type = 'START' > AND t1.date <= xxx > AND NOT EXISTS (SELECT 0 > FROM EVENTS t2 > WHERE t1.date < t2.date > AND t2.date <= xxx > AND t2.event_type = 'STOP') >
I think that would work, yes. In which case using search_literal() would get around the need for the table sub-select. A good suggestion, thankyou. Though I am still interested in the other half of the problem - if I _have_ to do a table sub-select in DBIx::Class, is the way I laid out the "right" way...? Thanks, -- Jon _______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
