matthew couchman (JIC) wrote:
> Hi,
> 
> I came back to this problem and I think I've got it sorted now so I thought 
> it might be useful to post the solution in case anybody else was having the 
> same problem. My problem was that quotes were being added to the zero 
> argument. So the revised query looks like this:
> 
> my $years_rs = $c->model($table_name)->search(
>     {
>         date => { '!=', \"0" }
>     },
>     {
>         select => [ \'YEAR(date) AS year' ], 
>         as => [ 'year' ], 
>         group_by => [ 'year' ]
>     }
> );
> 

This is not a solution, please do not popularize hideous crap like this
in a public forum.

> My problem was that quotes were being added to the zero argument.

^^ This can not be a problem with placeholders, as quotation is
absolutely irrelevant. I took the time to write a test case and kindly
asked you to try it against your own mysql server. Please do so and
come back with the results.

_______________________________________________
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