FROM sales_flat_order sfo INNER JOIN sales_flat_order_item sfoi ...
I don't think what your are trying to do will work without using "group by" or GROUP_CONCAT because a order my have many items and you can not have ...
these two tables is sales_flat_order.entity_id = sales_flat_order_item.order_id.
Magento will not do this automatically, you'll need to do that yourself. It will be done the same way you created attribute for order item. You'll just need to observe ...
... qty_ordered, `sales_flat_order_item`.created_at. FROM `sales_flat_order_item ` JOIN `sales_flat_order` ON `sales_flat_order_item`.order_id ...
Add two indexes, in sales_flat_order & sales_flat_order_item #384
... query was: SELECT count(DISTINCT e.entity_id) FROM `sales_flat_order_item ` AS `order_items` INNER JOIN `sales_flat_order` AS `order` ...
FROM sales_flat_order_item AS order_items INNER JOIN sales_flat_order AS `order` ...
Does your Magento order grid have all of the fields you need?
sales_flat_order. where. entity_id not in (. SELECT. o.entity_id. FROM. sales_flat_order o. LEFT JOIN. sales_flat_order_item i. ON o.entity_id = i. order_id.