Average Items Per Order |
Post Reply |
Author | |
MOlson
Newbie Joined: 16-November-2005 Status: Offline Points: 0 |
Post Options
Thanks(0)
Posted: 14-February-2007 at 6:14pm |
I need a little help with some SQL. We are registering with shop.org and they are asking for some data on our site. Could someone help me with the query for: Average Number of Items Per Order for 2006 Thanks in advance for any help. I've busted out the old college database books and it scares me. Edited by MOlson - 14-February-2007 at 6:14pm |
|
MOlson
Newbie Joined: 16-November-2005 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
I think I got it, if anyone sees a problem with this please let me know, just don't tell my Marketing department SELECT orders.idOrder, SUM(ProductsOrdered.quantity) as "Total Products"FROM orders INNER JOIN ProductsOrdered ON orders.idOrder = ProductsOrdered.idOrderWHERE ((orderStatus > 2 AND orderStatus < 5) OR (orderStatus > 6 AND orderStatus < 9)) AND orderDate >= '01/01/2006' AND orderDate <= '12/31/2006'GROUP BY orders.idOrderorder by orders.idOrder; |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |