SELECT wposts.*, wpostmeta.*
FROM wp_posts wposts, wp_postmeta wpostmeta, wp_postmeta wpostmeta2, wp_postmeta wpostmeta3
WHERE
wposts.ID = wpostmeta.post_id
AND wposts.ID = wpostmeta2.post_id
AND wposts.ID = wpostmeta3.post_id
AND wpostmeta.meta_key = 'listing_subtype'
AND wpostmeta.meta_value = 'Seattle'
AND wpostmeta2.meta_key = 'district'
AND wpostmeta2.meta_value = 'Breadview'
AND wpostmeta3.meta_key = 'price_current'
AND wpostmeta3.meta_value BETWEEN 0 AND 800000
AND wposts.post_status = 'publish'
AND wposts.post_type = 'vreb_property'
ORDER BY wposts.post_date DESC
LIMIT 0, 20
我现在正在查看这个查询,并认为我应该提高它的效率。而且我一直在尝试很多变化,我认为最好要求 SO 输入。