This might help:

http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Using_SQL_functions_on_the_left_hand_side_of_a_comparison
http://search.cpan.org/~frew/SQL-Abstract-1.72/lib/SQL/Abstract.pm#Literal_SQL_with_placeholders_and_bind_values_%28subqueries%29

> Date: Thu, 17 Feb 2011 15:01:54 +0000
> From: [email protected]
> To: compbio.dundee.ac.uk:Class user and developer list 
> [email protected]
> Subject: [Dbix-class] Filtering a SELECT based on a calculation of two        
> columns?
> 
> Hi all,
> 
> I've got a table where two of the columns (say a and b) are simple 
> integers and I want to select rows where b - a < 100. How do I go about 
> that in DBIx.
> 
> The equivalent SQL would be:
> SELECT * FROM table WHERE b - a < 100;
> 
> I've had a look at the Cookbook and FAQ, but can't see a solution there.
> TIA
> 
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/[email protected]
                                          
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to