SQL Error when filter Order table with Customer Name
-
When I try to filter a Customer on WooCommerce Orders table in admin panel, I get this error.
WordPress database error: [Not unique table/alias: 'wp_postmeta'] SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id WHERE 1=1 AND (((wp_posts.post_title LIKE '%Marie-Lusie%') OR (wp_postmeta.meta_value LIKE '%Marie-Lusie%') OR (wp_posts.post_excerpt LIKE '%Marie-Lusie%') OR (wp_posts.post_content LIKE '%Marie-Lusie%')) AND ((wp_posts.post_title LIKE '%Lück%') OR (wp_postmeta.meta_value LIKE '%Lück%') OR (wp_posts.post_excerpt LIKE '%Lück%') OR (wp_posts.post_content LIKE '%Lück%'))) AND ( ( wp_postmeta.meta_key = '_customer_user' AND wp_postmeta.meta_value = '52' ) ) AND wp_posts.post_type = 'shop_order' AND ((wp_posts.post_status = 'wc-pending' OR wp_posts.post_status = 'wc-processing' OR wp_posts.post_status = 'wc-on-hold' OR wp_posts.post_status = 'wc-completed' OR wp_posts.post_status = 'wc-cancelled' OR wp_posts.post_status = 'wc-refunded' OR wp_posts.post_status = 'wc-failed')) GROUP BY wp_posts.ID ORDER BY (CASE WHEN wp_posts.post_title LIKE '%Marie-Lusie Lück%' THEN 1 WHEN wp_posts.post_title LIKE '%Marie-Lusie%' AND wp_posts.post_title LIKE '%Lück%' THEN 2 WHEN wp_posts.post_title LIKE '%Marie-Lusie%' OR wp_posts.post_title LIKE '%Lück%' THEN 3 WHEN wp_posts.post_excerpt LIKE '%Marie-Lusie Lück%' THEN 4 WHEN wp_posts.post_content LIKE '%Marie-Lusie Lück%' THEN 5 ELSE 6 END), wp_posts.post_date DESC LIMIT 0, 40
I look forward to hearing from you.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘SQL Error when filter Order table with Customer Name’ is closed to new replies.