Skip to content

Instantly share code, notes, and snippets.

@spencerfinnell

spencerfinnell/query.sql Secret

Created Jul 9, 2018
Embed
What would you like to do?
LEFT JOIN wp_4_term_relationships
ON (wp_4_posts.ID = wp_4_term_relationships.object_id)
INNER JOIN wp_4_postmeta
ON ( wp_4_posts.ID = wp_4_postmeta.post_id )
WHERE wp_4_posts.post_type = 'product'
AND wp_4_posts.post_status = 'publish' 
AND ( wp_4_posts.ID NOT IN ( 
SELECT object_id 
FROM wp_4_term_relationships 
WHERE term_taxonomy_id IN (7) ) 
AND wp_4_term_relationships.term_taxonomy_id IN (14) )
AND ( ( wp_4_postmeta.meta_key = '_price'
AND CAST(wp_4_postmeta.meta_value AS DECIMAL(10,2)) BETWEEN '1'
AND '82' ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment