I have a listing with properties. Right now I have ORDER BY property_price ASC. The point is, a property can be a special Offer (offer_price). if that is the case for that particular property the normal price(property_price) should not longer be counted for the ORDER BY, instead the offer_price should be the price! Is this possible?

Thank you in advance

guido2004
—
2011-05-19T14:51:49Z —
#2

ORDER BY
CASE
WHEN special offer THEN offer_price
ELSE property_price
END ASC

r937
—
2011-05-19T17:07:16Z —
#3

if the existence of a special offer depends on whether the offer_price is null or not null, use this --

ORDER BY <font color='"Blue"'>COALESCE(offer_price,property_price)</font>