What does this do?
SELECT COUNT(*) AS TotalOrders,
Sum(PRICE * QUANTITY) AS Revenue
FROM store_orders
WHERE (MERC_ID = 1)
GROUP BY status
Matthew Walker
Electric Sheep Web
http://www.electricsheep.co.nz/
----- Original Message -----
From: "Owens, Howard" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, February 23, 2003 11:03 AM
Subject: OT: SQL math question
>
>
> I'm trying to come up with a query that will tell me:
>
> 1) How many orders have been place
> 2) What the total income from those orders ad up to.
>
> I tried this, but it isn't giving me what I expect:
>
> SELECT COUNT(STATUS) AS TotalOrders, PRICE * QUANTITY AS Revenue
> FROM store_orders
> WHERE (MERC_ID = 1)
> GROUP BY PRICE, QUANTITY
>
> That would be the simple way of doing ...
>
> Alternatively, I would like the query to break down the same information
> based on STATUS (pending, paid, shipped, etc), along with total
aggregrate.
>
> Any pointers would be appreciated.
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Owens
> Internet Operations Coordinator
> InsideVC.com/Ventura County Star
> [EMAIL PROTECTED]
> AIM: GoCatGo1956
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4