Last active
August 29, 2015 14:11
-
-
Save joelbrewer/19fc40e33dc980425ba5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SKU | FINAL_PRICE | CREATED_ON | | |
----------|-------------|---------------------| | |
SKU_1 | 700.00 | 2009-07-20 12:07:31 | | |
SKU_3 | 200.00 | 2009-07-22 12:07:31 | | |
SKU_7 | 700.00 | 2009-07-25 12:07:31 | | |
SKU_10 | 900.00 | 2009-07-30 12:07:31 | | |
SKU_11100 | 10.00 | 2009-07-31 12:07:31 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATE | SKU_1 | SKU_3 | SKU_4 | SKU_9 | | |
----------|-------|-------|-------|-------| | |
1-01-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-02-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-03-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-04-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-05-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-06-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-07-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-08-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-09-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-10-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-11-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-12-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-13-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-14-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-15-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-16-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-17-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-18-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-19-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-20-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-21-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-22-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-23-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-24-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-25-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-26-2014 | 10.00 | 100.00| 500.00| 10.00 | | |
1-27-2014 | 500.00| 400.00| 500.00| 700.00| | |
1-28-2014 | 20.00| 0.00 | 500.00| 800.00| | |
1-29-2014 | 0.00 | 20.00 | 500.00| 90.00 | | |
1-30-2014 | 10.00 | 100.00| 500.00| 10.00 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
DATE_FORMAT(created_on, '%m-%d-%Y') as date, | |
order_item_sku, | |
SUM(product_item_price) | |
FROM j25_virtuemart_order_items as v | |
LEFT JOIN | |
( | |
select (select @n= @n - interval 1 day) n | |
from j25_content limit 30 | |
) AS d ON DATE_FORMAT(v.created_on, '%Y-%m-%d') = d.n | |
WHERE v.created_on between FROM_UNIXTIME(1415577600) AND NOW() | |
GROUP BY v.created_on, v.order_item_sku |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment