donboe — 2011-05-19T10:45:23-04:00 — #1
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-19T10:51:49-04:00 — #2
WHEN special offer THEN offer_price
r937 — 2011-05-19T13:07:16-04:00 — #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>
and some people say they don't like NULLs! crazy, i tell ya!