I want to get a column like (datetime % 3600) / 60
as minute,But I use
$collection->columns('(datetime%3600)/60 as minute')
But I got SQL is `main_table`.`datetime%3600/60` AS `minute`
How I fixed It?
I want to get a column like (datetime % 3600) / 60
as minute,But I use
$collection->columns('(datetime%3600)/60 as minute')
But I got SQL is `main_table`.`datetime%3600/60` AS `minute`
How I fixed It?
Use Zend_Db_Expr
for expressions instead of column names:
columns(new Zend_Db_Expr('(datetime%3600)/60 as minute'))