Turn Numbers into Actions

Menu

Skip to content
  • About

Archive of posts tagged items per order

Magento SQL – Getting the average number of items per order

Posted by OlgaK on 10 July 2015, 2:02 pm
SELECT AVG( items_num ) AS AvgItemsOrder
FROM (

SELECT order_id, COUNT( item_id ) items_num
FROM  `sales_flat_order_item` 
GROUP BY order_id
)ItemsOrder

View on Github

Filed under SQL | Tagged average number of items, average number of items per order, items per order, magento, query, query MySQL, sql, SQL for Magento | Comment

Magento SQL – Counting the number of items per order

Posted by OlgaK on 10 July 2015, 1:57 pm
SELECT sfo.increment_id, COUNT( item_id ) items_number
FROM  `sales_flat_order_item` AS sfoi
INNER JOIN  `sales_flat_order` AS sfo ON sfo.entity_id = sfoi.order_id
GROUP BY order_id
LIMIT 0 , 30

View on Github

Filed under SQL | Tagged items per order, magento, query, query MySQL, sql, SQL for Magento | Comment

Recent Posts

  • D3 Visualization of the Median Market Value of Two Bedroom Homes within some LA Neighborhoods
  • Turn Google Analytics Numbers into Actions with Tableau
  • How to extract Google Analytics data in R and Excel
  • Magento MySQL – The most popular sold product per day
  • Place the results of a MySQL query into a CSV file
  • Magento MySQL – CURDATE() vs NOW()
  • Magento SQL – Five most popular products in general
  • Magento SQL – Getting the average number of items per order
  • Magento SQL – Counting the number of items per order
  • Magento MySQL – Calculate average number of orders per day and per month

Categories

  • D3
  • Financial Modeling
    • Real Estate Modeling
  • R
  • SQL
  • Tableau
    • Google Analytics

Tag Cloud

box chart bubble chart control chart CSV CURDATE() d3 data data extraction frequency distribution ga Google GoogleAnalytics Google Analytics visualization header home value include header items per order javascript javascript library js LA last 30 days library Los Angels magento map Tableau most popular product MySQL MySQL into CSV package query query MySQL R report RGoogleAnalytics sql SQL for Magento subsetting data in R Tableau Tableau visualization treemap trend visualization waterfall chart Zillow
© 2015 Turn Numbers into Actions