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

Chris Cole chris at compbio.dundee.ac.uk
Thu Feb 17 15:01:54 GMT 2011


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



More information about the DBIx-Class mailing list