Myslím, že jste napsali SELECTy na špatné místo.
SELECT (
SELECT meta_value as product_id
FROM ctc_woocommerce_order_itemmeta
LEFT JOIN ctc_woocommerce_order_items ON ctc_woocommerce_order_itemmeta.order_item_id = ctc_woocommerce_order_items.order_item_id
WHERE meta_key = '_product_id'
AND order_id = 3988
) as product_id,
(
SELECT meta_value as variation_id
FROM ctc_woocommerce_order_itemmeta
LEFT JOIN ctc_woocommerce_order_items ON ctc_woocommerce_order_itemmeta.order_item_id = ctc_woocommerce_order_items.order_item_id
WHERE meta_key = '_variation_id'
AND order_id = 3988
) as variation_id;