Это мой SQL-запрос WooCommerce ниже.Я получаю сообщение об ошибке,
Unknown column 'posts.ID' is 'on clause'
, но мой столбец posts.ID существует.
SELECT DISTINCT posts.ID as product_id, posts.post_parent as parent_id FROM wp_posts posts,
wp_terms terms, wp_term_relationships term_relationships LEFT JOIN wp_wc_product_meta_lookup
wc_product_meta_lookup ON posts.ID=wc_product_meta_lookup.product_id WHERE
posts.ID=term_relationships.object_id AND term_relationships.term_taxonomy_id=terms.term_id
AND terms.name!='exclude-from-catalog' AND posts.post_type IN ('product')
AND ( ( ( posts.post_title LIKE '%bruno%') OR ( posts.post_excerpt LIKE '%bruno%')
OR ( posts.post_content LIKE '%bruno%' ) OR ( wc_product_meta_lookup.sku LIKE '%bruno%' ) ))
AND posts.post_status IN ('publish') ORDER BY posts.post_parent ASC, posts.post_title ASC;