September 16, 2008 at 10:30 am
Hello
I have a table that consist of a unique field (CC #), and what I want to do is to retrive the number of Orders (OrderID) placed with the same CC #.
Does anyone have an idea around this, will i need a subquery?
September 16, 2008 at 12:53 pm
b_boy (9/16/2008)
HelloI have a table that consist of a unique field (CC #), and what I want to do is to retrive the number of Orders (OrderID) placed with the same CC #.
Does anyone have an idea around this, will i need a subquery?
select cc, count(*) cnt
from tablename
group by cc
order by cc
?
* Noel
September 16, 2008 at 1:01 pm
September 17, 2008 at 1:54 am
Thanks you guys have helped me alot, I ran the query with you guidnace and it worked fine, but i was wandering if there is a way I can aggregate the result, with a date range.
In other words if i run the query, I wan the result set to say that a certain amout of orders had the same CC used...
September 17, 2008 at 8:52 pm
A bit more info is required... please see the link in my signature for faster, better, tested answers....
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy