May 10, 2016 at 4:10 am
Hi everyone,
I am looking for a query that would use one column (A) multiplied by another column (B) and it would give me the results I am looking for.
DataFromColumnA would be UnitQuantity
DataFromColumnB would be Price
So far I have
select CustomerId, Product, COUNT (DataFromColumnA * DataFromColumnB) as TotalPrice from Table
where CustomerId = '123456' and UnitQuantity > 0
group by CustomerId, Product
And the results I get so far is either a 1 or a 0.
Thank you in advance for your help.
Celine
May 10, 2016 at 4:47 am
Thank you!!
I've used count before that's why I was using it again, didn't even think about SUM!
Thanks again, have a good day
🙂
May 10, 2016 at 4:52 am
No problem!
For a refresher of the various aggregates and their jobs, check out this page: https://msdn.microsoft.com/en-gb/library/ms173454.aspx
May 10, 2016 at 5:21 am
Even better!! Thanks again :satisfied:
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply