SQL Syntax Error
-
Seeing this SQL syntax error in the error_log occasionally. It looks like both an INNER JOIN and a LEFT JOIN use
wp_postmetawithout an alias.[12-Sep-2025 14:33:54 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query 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 LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
[12-Sep-2025 14:34:05 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query 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 LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts[12-Sep-2025 14:34:11 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query 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 LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts[12-Sep-2025 14:34:26 UTC] WordPress database error Not unique table/alias: 'wp_postmeta' for query 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 LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (( ttax.taxonomy = 'ml-slider' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)
WHERE 1=1 AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( (wp_posts.ID LIKE '%transfer station%') OR (wp_posts.post_title LIKE '%transfer station%') OR (wp_posts.guid LIKE '%transfer station%') OR (wp_posts.post_content LIKE '%transfer station%') OR (wp_posts.post_excerpt LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attachment_image_alt' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (wp_postmeta.meta_key = '_wp_attached_file' AND wp_postmeta.meta_value LIKE '%transfer station%') OR (tter.slug LIKE '%transfer station%') OR (ttax.description LIKE '%transfer station%') OR (tter.name LIKE '%transfer station%') )
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 100 made by require_once('wp-admin/admin-header.php'), do_action('admin_enqueue_scripts'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Future\Modules\Workflows\Controllers\FutureLegacyAction->enqueueScriptsLegacyAction, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithLegacyTriggerAsOptions, PublishPress\Future\Modules\Workflows\Models\WorkflowsModel->getPublishedWorkflowsWithMetadataAsOptions, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.