SELECT p.ID AS order_id,
p.post_date AS order_date,
woi.order_item_name AS product_title,
woim.meta_key
FROM wp_posts AS p
INNER JOIN wp_woocommerce_order_items AS woi ON p.ID = woi.order_id
INNER JOIN wp_woocommerce_order_itemmeta AS woim ON woi.order_item_id = woim.order_item_id
WHERE p.post_type = 'shop_order'
AND p.post_status IN ('wc-completed', 'wc-processing', 'wc-on-hold')
AND woim.meta_key = '_product_id'
AND woim.meta_value = '37' -- Replace it with your Product/Post ID
AND woi.order_item_type = 'line_item'
AND DATE(p.post_date) BETWEEN '2016-09-17' AND '2017-01-15';
-- ----------------------------------------------------
-- ----------------------------------------------------
SELECT p.ID AS order_id,
p.post_date AS order_date,
woi.order_item_name AS product_title,
woim.meta_key
FROM wp_posts AS p
INNER JOIN wp_woocommerce_order_items AS woi ON p.ID = woi.order_id
INNER JOIN wp_woocommerce_order_itemmeta AS woim ON woi.order_item_id = woim.order_item_id
WHERE p.post_type = 'shop_order'
AND p.post_status IN ('wc-completed', 'wc-processing', 'wc-on-hold')
AND woim.meta_key = '_product_id'
AND woim.meta_value =
(SELECT pro.ID
FROM wp_posts AS pro
INNER JOIN wp_postmeta AS prom ON pro.ID = prom.post_id
WHERE pro.post_type = 'product'
AND pro.post_status = 'publish'
AND prom.meta_key = '_sku'
AND prom.meta_value = 'some_SKU' -- Replace it with your SKU
LIMIT 1)
AND woi.order_item_type = 'line_item'
AND DATE(p.post_date) BETWEEN '2016-09-17' AND '2017-01-15';