ontwerps

Magento orders by sku

SQL code for orders by sku

SQL code for orders by sku


SELECT sales_flat_order.increment_id,
 sales_flat_order_item.order_id,
 sales_flat_order_item.sku,
 sales_flat_order.status,
 sales_flat_order_item.name,
 sales_flat_order.customer_email
 FROM dbname.sales_flat_order_item sales_flat_order_item
 INNER JOIN dbname.sales_flat_order sales_flat_order
 ON (sales_flat_order_item.order_id = sales_flat_order.entity_id)
 WHERE (sales_flat_order_item.sku = 'fill in sku no ')
 AND (sales_flat_order.status <> 'Canceled')
ORDER BY sales_flat_order.increment_id DESC


Comments are closed.