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

Acquisition Model average number of items average number of items per order average number of orders CSV data analysis data from the web with R data science download file with R Excel Excel Model financial feasibility Financial Modeling ga get data with R GoogleAnalytics Income Aproach Intrinsic Value of the Property items per order library Loan Amortization Schedule magento Multi-family Building Acquisition names in R NOW() nrow in R orders per day orders per month query query MySQL R read file with R reading data with R Real Estate Excel Model Real Estate Modeling select a certain row and a column in R sql SQL for Magento subset subset a certain observation in R subset a column in R subset a row in R subset in R subsetting data in R tail in R
© 2015 Turn Numbers into Actions