Skip to main content
edited body; edited tags
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

I want to get a column like (datetime%3600)/60(datetime % 3600) / 60 as minute,But I use

$collection->columns('(datetime%3600)/60 as minute')

But I got sqlSQL is main_table.datetime%3600`main_table`.`datetime%3600/60 AS minute60` AS `minute`

How I fixed It. Thank you.?

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. Thank you.

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?

Source Link

How to get column such as that By collection

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. Thank you.