WordPress database error: [Not unique table/alias: 'e8nEu_term_relationships']SELECT SQL_CALC_FOUND_ROWS e8nEu_posts.ID
FROM e8nEu_posts LEFT JOIN e8nEu_term_relationships ON (e8nEu_posts.ID = e8nEu_term_relationships.object_id) LEFT JOIN e8nEu_icl_translations wpml_translations
ON e8nEu_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT('post_', e8nEu_posts.post_type) LEFT JOIN e8nEu_term_relationships ON (e8nEu_posts.ID = e8nEu_term_relationships.object_id)
WHERE 1=1 AND (
e8nEu_term_relationships.term_taxonomy_id IN (203)
) AND ((e8nEu_posts.post_type = 'product' AND (e8nEu_posts.post_status = 'publish' OR e8nEu_posts.post_status = 'wc-pre-order'))) AND ( ( ( wpml_translations.language_code = 'en' OR (
wpml_translations.language_code = 'en'
AND e8nEu_posts.post_type IN ( 'e-floating-buttons','elementor_library','product','order_status' )
AND ( (
( SELECT COUNT(element_id)
FROM e8nEu_icl_translations
WHERE trid = wpml_translations.trid
AND language_code = 'en'
) = 0
) OR (
( SELECT COUNT(element_id)
FROM e8nEu_icl_translations t2
JOIN e8nEu_posts p ON p.id = t2.element_id
WHERE t2.trid = wpml_translations.trid
AND t2.language_code = 'en'
AND (
p.post_status = 'publish' OR p.post_status = 'private' OR
( p.post_type='attachment' AND p.post_status = 'inherit' )
)
) = 0 ) )
) ) AND e8nEu_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','e-floating-buttons','elementor_library','product','product_variation','wpcf7_contact_form','order_status','mc4wp-form' ) ) OR e8nEu_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','e-floating-buttons','elementor_library','product','product_variation','wpcf7_contact_form','order_status','mc4wp-form' ) ) AND ( ( e8nEu_posts.ID IN ( SELECT DISTINCT prlg.post_parent FROM e8nEu_atum_inventories ati
LEFT JOIN e8nEu_posts pr ON ati.product_id = pr.ID
LEFT JOIN e8nEu_icl_translations tr ON pr.ID = tr.element_id AND CONCAT('post_', pr.post_type) = tr.element_type
LEFT JOIN e8nEu_icl_translations trlg ON tr.trid = trlg.trid AND trlg.language_code = 'en'
LEFT JOIN e8nEu_posts prlg ON trlg.element_id = prlg.ID
LEFT JOIN e8nEu_atum_inventory_meta atim ON ati.ID = atim.inventory_id
LEFT JOIN e8nEu_wc_product_meta_lookup pml ON ati.product_id = pml.product_id
LEFT JOIN e8nEu_atum_product_data apd ON ati.product_id = apd.product_id
WHERE (apd.multi_inventory = 1 OR apd.multi_inventory IS NULL) AND ( pml.stock_status IN ('instock','onbackorder') OR atim.stock_status IN ('instock','onbackorder')) AND pr.post_parent IS NOT NULL AND pr.post_parent > 0 ) OR e8nEu_posts.ID IN ( SELECT DISTINCT prlg.ID FROM e8nEu_atum_inventories ati
LEFT JOIN e8nEu_posts pr ON ati.product_id = pr.ID
LEFT JOIN e8nEu_icl_translations tr ON pr.ID = tr.element_id AND CONCAT('post_', pr.post_type) = tr.element_type
LEFT JOIN e8nEu_icl_translations trlg ON tr.trid = trlg.trid AND trlg.language_code = 'en'
LEFT JOIN e8nEu_posts prlg ON trlg.element_id = prlg.ID
LEFT JOIN e8nEu_atum_inventory_meta atim ON ati.ID = atim.inventory_id
LEFT JOIN e8nEu_wc_product_meta_lookup pml ON ati.product_id = pml.product_id
LEFT JOIN e8nEu_atum_product_data apd ON ati.product_id = apd.product_id
WHERE (apd.multi_inventory = 1 OR apd.multi_inventory IS NULL) AND ( pml.stock_status IN ('instock','onbackorder') OR atim.stock_status IN ('instock','onbackorder')) )) AND (
e8nEu_term_relationships.term_taxonomy_id IN (12)
AND
e8nEu_posts.ID NOT IN (
SELECT object_id
FROM e8nEu_term_relationships
WHERE term_taxonomy_id IN (7,9)
)
)
OR ( e8nEu_posts.ID IN (
SELECT DISTINCT e8nEu_posts.ID FROM e8nEu_posts
LEFT JOIN e8nEu_atum_product_data apd ON e8nEu_posts.ID = apd.product_id
LEFT JOIN e8nEu_wc_product_meta_lookup pml ON e8nEu_posts.ID = pml.product_id
LEFT JOIN e8nEu_term_relationships ON (e8nEu_posts.ID = e8nEu_term_relationships.object_id)
WHERE apd.multi_inventory = 0 AND pml.stock_status IN ('instock','onbackorder') AND (
e8nEu_term_relationships.term_taxonomy_id IN (12)
AND
e8nEu_posts.ID NOT IN (
SELECT object_id
FROM e8nEu_term_relationships
WHERE term_taxonomy_id IN (7,9)
)
) AND (
e8nEu_term_relationships.term_taxonomy_id IN (2,4)
)
) )
OR (
e8nEu_term_relationships.term_taxonomy_id IN (12)
AND
e8nEu_posts.ID NOT IN (
SELECT object_id
FROM e8nEu_term_relationships
WHERE term_taxonomy_id IN (7,9)
)
AND
e8nEu_posts.ID NOT IN (
SELECT object_id
FROM e8nEu_term_relationships
WHERE term_taxonomy_id IN (2,4)
)
) )
GROUP BY e8nEu_posts.ID
ORDER BY e8nEu_posts.post_date DESC, e8nEu_posts.ID DESC
LIMIT 0, 12