Tuesday, August 6, 2013

SQL Totals


SELECT DISTINCT sales_type, COUNT( sales_type) FROM orders GROUP BY sales_type

Gives result:

sales_type          COUNT(sales_type)
----------------  ---------------------
AMEX                 34
MSTRC             123
VISA                   23
ZCASH                 2