Hassle-free live chat software re-imagined for business growth. 2 users, always free.
SELECT CustID, SUM(case when ItemCategory = 10 THEN PubProfit else 0 END) as ChemProfit, AVG(SUM(case when ItemCategory = 10 THEN PubProfit else 0 END)) as ChemAvg, SUM(CASE When InvoiceDate between '2015-1-1' and '2015-12-31' THEN PubProfit ELSE 0 END) as Profit15 From vCustomerInvoiceDetail Where InvoiceDate Between '2015-1-1' and '2015-12-31' Group by CustID Order by Profit15 Desc Limit 150
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
19 Experts available now in Live!