I am working on a cashback site,According to category we are listing the name, cashback, and description of retailers,in listing page there are some options for sort a-z, heighest£ height% (a-z is order by name and other two are order by cashback) cashback mony are in different format eg: £14, 10.5%, upto 20%, 50p, various, etc. now i am facing a problem while sorting heighest%.if i click heighest% it will show 50p first then 50%, 34% ... i want like this, if i choose heighest% then the % cashback should come first in descending order then the £ values.upto,var ious, 50p all these values should come last.
here is my query.
thanks
Ruth
here is my query.
Code:
SELECT prod.shop_id, shop_display_name, shop_filename, commission_member, short_description, conditions, logo_filename, agent_link, prod.shop_id, cat_prod.sort_order, category_shops_id, review_id, cat.category_id, shop_content, shop_bartext, si_html_shopinfo, o_logo_filename, o_member_commission, o_agent_link, o_description, o_start, o_end, ((o_start <= NOW() AND o_end >= NOW()) OR (o_start = "0000-00-00" AND o_end = "0000-00-00")) AS o_flag FROM shops AS prod JOIN category_shops AS cat_prod ON prod.shop_id = cat_prod.shop_id JOIN categories AS cat ON cat_prod.category_id = cat.category_id LEFT JOIN reviews AS rev ON rev.shop_id = prod.shop_id AND rev.approved WHERE prod.active AND cat.active AND cat.category_id IN (65) ORDER BY CAST(REVERSE(RIGHT(REVERSE(commission_member),LOCATE('%',REVERSE(commission_member)) +2)) AS DECIMAL) DESC
thanks
Ruth