[Dbix-class] How to combine columns in a search()

Maurice Height mauriceh at bigpond.net.au
Wed Feb 8 14:34:32 CET 2006


Hi

Many thanks for the reply to my previous post.
I finally understood how to setup the arguments for a search()
using SQL functions.

My question now is - How do I code the "close/low >= 1.02" part of the
where clause in the following query?

SELECT code, day, open, close, volume
FROM   history
WHERE  day >= '2006-02-01' AND  day <= '2006-02-07'
       AND volume > 100000 AND  close/low >= 1.02
GROUP BY code

My setup for the 'history' table is:

package DB_Schema::History;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/Core/);
__PACKAGE__->table('history');
__PACKAGE__->add_columns(qw/code day open high low close volume/);
__PACKAGE__->set_primary_key(qw/code day/);
1;

Thanks
Maurice






More information about the Dbix-class mailing list