[Dbix-class] Re: search for equality between columns

Daniel McBrearty danielmcbrearty at gmail.com
Sun Jun 17 18:59:02 GMT 2007


gottit! thanks.


On 6/17/07, Dagfinn Ilmari Mannsåker <ilmari at ilmari.org> wrote:
> "Daniel McBrearty" <danielmcbrearty at gmail.com> writes:
>
> > table has two integer columns:
> >
> > id1 INTEGER,
> > id2 INTEGER
> >
> > sql query:
> >
> > SELECT COUNT(*) FROM table WHERE id1 = id2;
> >
> > how do I do this in dbix?
>
> my $count = $schema->resultset('Table')->search({ id1 => \'= id2' })->count;
>
> --
> ilmari
> "A disappointingly low fraction of the human race is,
>  at any given time, on fire." - Stig Sandbeck Mathisen
>
>
> _______________________________________________
> 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/dbix-class@lists.rawmode.org/
>


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com
danmcb.vox.com
danmcb.blogger.com
BTW : 0873928131



More information about the Dbix-class mailing list