[Dbix-class] Filtering a SELECT based on a calculation of two columns?

Fahad Khan fahad.a.khan at hotmail.com
Thu Feb 17 15:19:43 GMT 2011


This might help:

http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#U=
sing_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: chris at compbio.dundee.ac.uk
> To: compbio.dundee.ac.uk:Class user and developer list dbix-class at lists.s=
csys.co.uk
> Subject: [Dbix-class] Filtering a SELECT based on a calculation of two	co=
lumns?
> =

> 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/dbix-class@lists.scsys.=
co.uk
 		 	   		  =

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110217/b78=
58465/attachment.htm


More information about the DBIx-Class mailing list