WordPress database error: [Not unique table/alias: 'nb_postmeta']
SELECT SQL_CALC_FOUND_ROWS DISTINCT nb_posts.ID
FROM nb_posts LEFT JOIN nb_term_relationships ON (nb_posts.ID = nb_term_relationships.object_id) INNER JOIN nb_postmeta ON ( nb_posts.ID = nb_postmeta.post_id ) LEFT JOIN nb_icl_translations wpml_translations
ON nb_posts.ID = wpml_translations.element_id
AND wpml_translations.element_type = CONCAT('post_', nb_posts.post_type) LEFT JOIN nb_postmeta ON nb_posts.ID = nb_postmeta.post_id
WHERE 1=1 AND (
nb_posts.ID NOT IN (
SELECT object_id
FROM nb_term_relationships
WHERE term_taxonomy_id IN (13)
)
AND
nb_term_relationships.term_taxonomy_id IN (2504,2745,2748,2749,2750,2746,2751,2752,2753,2747,2754,2755,2756,2757,2758,2761,2760,2759,2762,2522,2582,2583,2584,2585,2586,2587,2588,2589)
) AND (
nb_postmeta.meta_key = 'total_sales'
) AND ((nb_posts.post_type = 'post' AND (nb_posts.post_status = 'publish' OR nb_posts.post_status = 'acf-disabled' OR nb_posts.post_status = 'wc-ywraq-new' OR nb_posts.post_status = 'wc-ywraq-pending' OR nb_posts.post_status = 'wc-ywraq-expired' OR nb_posts.post_status = 'wc-ywraq-accepted' OR nb_posts.post_status = 'wc-ywraq-rejected' OR nb_posts.post_status = 'wc-qb-spec-request' OR nb_posts.post_status = 'wc-qb-xls-request')) OR (nb_posts.post_type = 'page' AND (nb_posts.post_status = 'publish' OR nb_posts.post_status = 'acf-disabled' OR nb_posts.post_status = 'wc-ywraq-new' OR nb_posts.post_status = 'wc-ywraq-pending' OR nb_posts.post_status = 'wc-ywraq-expired' OR nb_posts.post_status = 'wc-ywraq-accepted' OR nb_posts.post_status = 'wc-ywraq-rejected' OR nb_posts.post_status = 'wc-qb-spec-request' OR nb_posts.post_status = 'wc-qb-xls-request')) OR (nb_posts.post_type = 'attachment' AND (nb_posts.post_status = 'publish' OR nb_posts.post_status = 'acf-disabled' OR nb_posts.post_status = 'wc-ywraq-new' OR nb_posts.post_status = 'wc-ywraq-pending' OR nb_posts.post_status = 'wc-ywraq-expired' OR nb_posts.post_status = 'wc-ywraq-accepted' OR nb_posts.post_status = 'wc-ywraq-rejected' OR nb_posts.post_status = 'wc-qb-spec-request' OR nb_posts.post_status = 'wc-qb-xls-request')) OR (nb_posts.post_type = 'product' AND (nb_posts.post_status = 'publish' OR nb_posts.post_status = 'acf-disabled' OR nb_posts.post_status = 'wc-ywraq-new' OR nb_posts.post_status = 'wc-ywraq-pending' OR nb_posts.post_status = 'wc-ywraq-expired' OR nb_posts.post_status = 'wc-ywraq-accepted' OR nb_posts.post_status = 'wc-ywraq-rejected' OR nb_posts.post_status = 'wc-qb-spec-request' OR nb_posts.post_status = 'wc-qb-xls-request')) OR (nb_posts.post_type = 'portfolio' AND (nb_posts.post_status = 'publish' OR nb_posts.post_status = 'acf-disabled' OR nb_posts.post_status = 'wc-ywraq-new' OR nb_posts.post_status = 'wc-ywraq-pending' OR nb_posts.post_status = 'wc-ywraq-expired' OR nb_posts.post_status = 'wc-ywraq-accepted' OR nb_posts.post_status = 'wc-ywraq-rejected' OR nb_posts.post_status = 'wc-qb-spec-request' OR nb_posts.post_status = 'wc-qb-xls-request')) OR (nb_posts.post_type = 'avia_framework_post' AND (nb_posts.post_status = 'publish' OR nb_posts.post_status = 'acf-disabled' OR nb_posts.post_status = 'wc-ywraq-new' OR nb_posts.post_status = 'wc-ywraq-pending' OR nb_posts.post_status = 'wc-ywraq-expired' OR nb_posts.post_status = 'wc-ywraq-accepted' OR nb_posts.post_status = 'wc-ywraq-rejected' OR nb_posts.post_status = 'wc-qb-spec-request' OR nb_posts.post_status = 'wc-qb-xls-request'))) AND ( ( ( wpml_translations.language_code = 'en' OR 0 ) AND nb_posts.post_type IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','um_form','product','product_variation','portfolio' ) ) OR nb_posts.post_type NOT IN ('post','page','attachment','wp_block','wp_template','wp_template_part','wp_navigation','um_form','product','product_variation','portfolio' ) )
GROUP BY nb_posts.ID
ORDER BY nb_postmeta.meta_value+0 ASC
LIMIT 0, 15