CakePHP - Paginate / Query: find lowest of multiple fields & order by it
Posted
by Atea
on Stack Overflow
See other posts from Stack Overflow
or by Atea
Published on 2010-04-05T15:30:21Z
Indexed on
2010/04/05
15:33 UTC
Read the original article
Hit count: 238
I am using CakePHP for a price-comparison website.
I have a table products with fields: id, pride_regular, price_action.
I would like to combine the fields price_regular and price_action into a dynamic field: price. The lowest value of these two fields should be the value of the new price field. Also I want to order on it Ascending.
Should I use a custom MySQL-query?
© Stack Overflow or respective owner