SELECT p.ID, GREATEST((SELECT meta_value FROM wp_postmeta WHERE post_id=p.ID AND meta_key='wdm_opening_bid'), (SELECT meta_value FROM wp_postmeta WHERE post_id=p.ID AND meta_key='wdm_buy_it_now')) AS price FROM wp_posts p RIGHT JOIN wp_wdm_auctions_live l ON p.ID=l.auc_id WHERE p.post_type='ultimate-auction' AND p.post_status='publish' ORDER BY p.ID DESC LIMIT 0,9
Ταξινόμηση:
No Entries yet.